Skip to content

Commit 844dbc3

Browse files
authored
Enable manual publish (#1473)
1 parent dbb51d7 commit 844dbc3

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

.github/workflows/publish.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ name: Publish package to the Maven Central Repository
33
on:
44
release:
55
types: [ published ]
6+
workflow_dispatch:
7+
inputs:
8+
version:
9+
description: 'The version to release'
10+
required: true
611

712
jobs:
813
publish:
@@ -26,17 +31,26 @@ jobs:
2631
run: |
2732
echo "Version=${{ github.event.release.tag_name }}"
2833
29-
- name: Publish package
34+
- name: Build package
3035
run: |
3136
./gradlew build
3237
38+
- name: Set version
39+
run: |
40+
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
41+
VERSION=${{ github.event.inputs.version }}
42+
else
43+
VERSION=${{ github.event.release.tag_name }}
44+
fi
45+
echo "VERSION=$VERSION" >> $GITHUB_ENV
46+
3347
- name: Publish package
3448
run: |
3549
./gradlew --no-daemon --stacktrace --max-workers=1 --info publish closeAndReleaseStagingRepository
3650
env:
3751
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
3852
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
39-
SDK_VERSION: ${{ github.event.release.tag_name }}
53+
SDK_VERSION: ${{ env.VERSION }}
4054
ORG_GRADLE_PROJECT_signingKeyId: ${{ secrets.GPG_KEY_ID }}
4155
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.GPG_PRIVATE_KEY }}
4256
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.GPG_PASSWORD }}

0 commit comments

Comments
 (0)