Skip to content

Commit 86e7d1c

Browse files
authored
Add optional version input to publish workflow (#1124)
Allow manually triggered releases to specify a project version before releasing. This enables releasing snapshot versions other than the one currently in pom.xml.
1 parent 3611355 commit 86e7d1c

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

.github/workflows/publish.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@
22
name: publish
33

44
on:
5-
workflow_dispatch: {}
5+
workflow_dispatch:
6+
inputs:
7+
version:
8+
description: 'Project version to set before releasing (e.g. 6.33.0-SNAPSHOT). Leave empty to release the current version.'
9+
required: false
10+
type: string
611

712
jobs:
813
release:
@@ -28,6 +33,10 @@ jobs:
2833
git config user.email "team@moderne.io"
2934
git config user.name "team-moderne[bot]"
3035
36+
- name: set-project-version
37+
if: ${{ inputs.version != '' }}
38+
run: ./mvnw versions:set -DnewVersion=${{ inputs.version }} -DgenerateBackupFiles=false
39+
3140
- name: bump-rewrite-properties-to-releases
3241
run: |
3342
./mvnw versions:update-properties -DincludeProperties=rewrite.version,rewrite-polyglot.version -DallowDowngrade=true

0 commit comments

Comments
 (0)