Release (1.0.0-SNAPSHOT) #48
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
run-name: "Release${{ inputs.version && format(' ({0})', inputs.version) || format(' (auto: {0})', github.ref_name) }}" | |
on: | |
release: | |
types: | |
- released | |
workflow_dispatch: | |
inputs: | |
version: | |
type: input | |
description: 'What version to use (default: derive from git)' | |
jobs: | |
publish: | |
name: Publish release | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: print GnuPG version | |
run: gpg --version | |
- name: Set up JDK 8 | |
uses: actions/setup-java@v3.4.1 | |
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 | |
env: | |
JAVA_OPTS: ${{ steps.version-override.outputs.JAVA_OPTS }} | |
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} | |
PGP_SECRET: ${{ secrets.PGP_SECRET }} | |
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | |
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} |