Skip to content

Commit d518d05

Browse files
Incorporate version override
1 parent 8360b41 commit d518d05

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

.github/workflows/release.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
name: Release
2+
run-name: "Release${{ inputs.version && format(' ({0})', inputs.version) || format(' (auto: {0})', github.ref_name) }}"
23

34
on:
45
release:
@@ -12,6 +13,9 @@ on:
1213
options:
1314
- From Tag
1415
- scala-pekko-http
16+
version:
17+
type: input
18+
description: 'What version to use (default: derive from git)'
1519

1620
jobs:
1721
publish:
@@ -40,11 +44,21 @@ jobs:
4044
run: |
4145
java -version
4246
gpg --version
47+
- name: Incorporate version override
48+
id: version-override
49+
run: |
50+
version="${{github.event.inputs.version}}"
51+
if [ -n "$version" ]; then
52+
# -Dproject.version permits overriding version
53+
# https://github.com/sbt/sbt-git/blob/HEAD/src/main/scala/com/github/sbt/git/GitPlugin.scala#L183
54+
echo "JAVA_OPTS=-Dproject.version=$version" >> $GITHUB_OUTPUT
55+
fi
4356
- name: 'Publish artifacts [scala-pekko-http]'
4457
if: ${{ steps.set-project-from-tag.outputs.module == 'scala-pekko-http' }}
4558
# run: sbt 'show version' "project guardrail-scala-pekko-http" clean compile versionCheck test ci-release
4659
run: sbt 'show version' "project guardrail-scala-pekko-http" clean compile versionCheck ci-release
4760
env:
61+
JAVA_OPTS: ${{ steps.version-override.outputs.JAVA_OPTS }}
4862
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
4963
PGP_SECRET: ${{ secrets.PGP_SECRET }}
5064
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}

0 commit comments

Comments
 (0)