Skip to content

Commit

Permalink
Permit overriding version
Browse files Browse the repository at this point in the history
  • Loading branch information
blast-hardcheese committed Dec 14, 2023
1 parent 0aec27e commit 54eacf4
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ on:
release:
types:
- released
workflow_dispatch: {}
workflow_dispatch:
inputs:
version:
type: input
description: 'What version to use (default: derive from git)'

jobs:
publish:
Expand All @@ -22,9 +26,19 @@ jobs:
with:
distribution: 'temurin'
java-version: 8
- name: Incorporate version override
id: version-override
run: |
version="${{github.event.inputs.version}}"
if [ -n "$version" ]; then
# -Dproject.version permits overriding version
# https://github.com/sbt/sbt-git/blob/HEAD/src/main/scala/com/github/sbt/git/GitPlugin.scala#L183
echo "JAVA_OPTS=-Dproject.version=$version" >> $GITHUB_OUTPUT
fi
- name: Publish artifacts
run: sbt ci-release publishLegacy
run: sbt ci-release
env:
JAVA_OPTS: ${{ steps.version-override.outputs.JAVA_OPTS }}
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
Expand Down

0 comments on commit 54eacf4

Please sign in to comment.