Skip to content

Commit 678704e

Browse files
SK-2967 update internal release workflow
1 parent 80e18fd commit 678704e

2 files changed

Lines changed: 12 additions & 20 deletions

File tree

.github/workflows/internal-release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Publish package to the JFROG Artifactory
1+
name: Publish v2 module to the JFROG Artifactory
22
on:
33
push:
44
tags-ignore:
@@ -9,7 +9,7 @@ on:
99
- release/*
1010

1111
jobs:
12-
build-and-deploy:
12+
build-and-deploy-v2:
1313
uses: ./.github/workflows/shared-build-and-deploy.yml
1414
with:
1515
ref: ${{ github.ref_name }}

.github/workflows/shared-build-and-deploy.yml

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -59,19 +59,19 @@ jobs:
5959
fetch-depth: 0
6060

6161
- name: Set up maven or jfrog repository
62-
uses: actions/setup-java@v4
62+
uses: actions/setup-java@v1
6363
with:
6464
java-version: "11"
6565
distribution: "adopt"
6666
server-id: ${{ inputs.server-id }}
67-
server-username: ${{ secrets.server-username }}
68-
server-password: ${{ secrets.server-password }}
67+
server-username: SERVER_USERNAME
68+
server-password: SERVER_PASSWORD
6969
gpg-private-key: ${{ secrets.gpg-key }} # Value of the GPG private key to import
70-
gpg-passphrase: ${{ secrets.gpg-passphrase }} # env variable for GPG private key passphrase
71-
70+
gpg-passphrase: GPG_PASSPHRASE # env variable for GPG private key passphrase
71+
7272
- name: Resolve Branch for the Tagged Commit
7373
id: resolve-branch
74-
if: ${{ inputs.tag == 'beta' || inputs.tag == 'public' }}
74+
if: ${{ inputs.tag == 'beta' || inputs.tag == 'public' }}
7575
run: |
7676
TAG_COMMIT=$(git rev-list -n 1 ${{ github.ref_name }})
7777
BRANCH_NAME=$(git branch -r --contains $TAG_COMMIT | grep -o 'origin/.*' | sed 's|origin/||' | head -n 1)
@@ -89,7 +89,6 @@ jobs:
8989
fallback: 1.0.0
9090

9191
- name: Bump Version
92-
id: bump-version
9392
run: |
9493
chmod +x ./scripts/bump_version.sh
9594
if ${{ inputs.tag == 'internal' }}; then
@@ -98,13 +97,6 @@ jobs:
9897
./scripts/bump_version.sh "${{ steps.previoustag.outputs.tag }}" "" "${{ inputs.module }}"
9998
fi
10099
101-
MODULE="${{ inputs.module }}"
102-
if [ -n "$MODULE" ]; then
103-
echo "pom_path=$MODULE/pom.xml" >> "$GITHUB_OUTPUT"
104-
else
105-
echo "pom_path=pom.xml" >> "$GITHUB_OUTPUT"
106-
fi
107-
108100
- name: Commit changes
109101
run: |
110102
git config user.name ${{ github.actor }}
@@ -114,7 +106,7 @@ jobs:
114106
git checkout ${{ env.branch_name }}
115107
fi
116108
117-
git add ${{ steps.bump-version.outputs.pom_path }}
109+
git add ${{ inputs.module }}/pom.xml
118110
if [[ "${{ inputs.tag }}" == "internal" ]]; then
119111
git commit -m "[AUTOMATED] Private Release ${{ steps.previoustag.outputs.tag }}-dev-$(git rev-parse --short $GITHUB_SHA)"
120112
git push origin ${{ github.ref_name }} -f
@@ -142,12 +134,12 @@ jobs:
142134
- name: Publish package
143135
run: |
144136
if [[ "${{ inputs.tag }}" == "internal" ]]; then
145-
mvn --batch-mode -pl ${{ inputs.module }} -am deploy -P jfrog -DskipTests
137+
mvn --batch-mode -pl ${{ inputs.module }} -am deploy -P jfrog -DskipTests
146138
elif [[ "${{ inputs.tag }}" == "beta" || "${{ inputs.tag }}" == "public" ]]; then
147-
mvn --batch-mode -pl ${{ inputs.module }} -am deploy -P ${{ inputs.profile }} -DskipTests
139+
mvn --batch-mode -pl ${{ inputs.module }} -am deploy -P ${{ inputs.profile }}
148140
fi
149141
150142
env:
151143
SERVER_USERNAME: ${{ secrets.server-username }}
152144
SERVER_PASSWORD: ${{ secrets.server-password }}
153-
GPG_PASSPHRASE: ${{ secrets.gpg-passphrase }}
145+
GPG_PASSPHRASE: ${{ secrets.gpg-passphrase }}

0 commit comments

Comments
 (0)