Skip to content

Commit caadbfe

Browse files
tishunthachlp
authored andcommitted
Modify the release acrtion to call the proper maven target for release, make releasing manually available too (redis#2885)
1 parent 544ec67 commit caadbfe

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

.github/workflows/version-and-release.yaml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,25 @@ name: Release
22

33
on:
44
release:
5-
types: [published]
5+
types: [published] # once a release is published in the GitHub UI
6+
workflow_dispatch: # or manually, by clicking the button
67

78
jobs:
89
build:
910
runs-on: ubuntu-latest
1011

1112
steps:
12-
- uses: actions/checkout@v4
13+
- name: 1. Checkout sources
14+
uses: actions/checkout@v4
1315

14-
- name: get version from tag
16+
- name: 2. Extract version from tag
1517
id: get_version
1618
run: |
1719
realversion="${GITHUB_REF/refs\/tags\//}"
1820
realversion="${realversion//v/}"
1921
echo "VERSION=$realversion" >> $GITHUB_OUTPUT
2022
21-
- name: Set up publishing to maven central
23+
- name: 3. Set up Java with Maven cache
2224
uses: actions/setup-java@v4
2325
with:
2426
java-version: '8'
@@ -28,20 +30,20 @@ jobs:
2830
server-username: MAVEN_USERNAME
2931
server-password: MAVEN_PASSWORD
3032

31-
- name: mvn versions
33+
- name: 4. Update version in Maven configuration
3234
run: mvn versions:set -DnewVersion=${{ steps.get_version.outputs.VERSION }}
3335

34-
- name: Install gpg key
36+
- name: 5. Install GPG key
3537
run: |
3638
cat <(echo -e "${{ secrets.OSSH_GPG_SECRET_KEY }}") | gpg --batch --import
3739
gpg --list-secret-keys --keyid-format LONG
3840
39-
- name: Publish
41+
- name: 6. Publish to Maven
4042
run: |
4143
mvn --no-transfer-progress \
4244
--batch-mode \
4345
-Dgpg.passphrase='${{ secrets.OSSH_GPG_SECRET_KEY_PASSWORD }}' \
44-
deploy -P release
46+
release:perform
4547
env:
4648
MAVEN_USERNAME: ${{secrets.OSSH_USERNAME}}
47-
MAVEN_PASSWORD: ${{secrets.OSSH_TOKEN}}
49+
MAVEN_PASSWORD: ${{secrets.OSSH_TOKEN}}

0 commit comments

Comments
 (0)