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 242e61d
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
name: Release

run-name: "Release${{ inputs.version && format(' ({0})', inputs.version) || format(' (auto: {0})', github.ref_name) }}"

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 +28,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 242e61d

Please sign in to comment.