-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (44 loc) · 1.44 KB
/
publish_workflow.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: Publish Pipeline
run-name: 'Publish Artifacts For ${{github.ref_name}}'
on:
workflow_call:
inputs:
is_snapshot_version:
type: string
required: true
version_name:
type: string
required: true
repository_name:
type: string
required: true
branch_name:
type: string
required: true
jobs:
publish-to-artifact-repositories:
name: Publish To Nexus & OSSRH
runs-on: ubuntu-latest
env:
REPOSITORY_ID: "maven-snapshots"
steps:
- name: Checkout Code Repository
uses: actions/checkout@v4
with:
repository: ${{inputs.repository_name}}
ref: ${{inputs.branch_name}}
- name: Downloading Java
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'adopt'
- name: Print Current Version
run: echo "Current Version Is - ${{inputs.version_name}}"
- name: Check If Release Version
if: ${{ inputs.is_snapshot_version == 'false'}}
run: echo "REPOSITORY_ID=maven-release" >> $GITHUB_ENV
- name: Deploy To Nexus
run: echo "Deploy artifact to nexus - ${{env.REPOSITORY_ID}}"
- name: Deploy To OSSRH
if: ${{ inputs.is_snapshot_version == 'false'}}
run: echo "Deploy aftifacts to OSSRH