-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update release.yml to use new action
Co-authored-by: Paul Roberts <[email protected]>
- Loading branch information
Showing
3 changed files
with
40 additions
and
47 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,23 @@ | ||
name: Release Sonatype | ||
name: 'Publish Release' | ||
|
||
on: | ||
release: | ||
types: [published] | ||
workflow_dispatch: | ||
inputs: | ||
isSnapshot: | ||
description: Produce a snapshot release | ||
required: true | ||
default: true | ||
type: boolean | ||
|
||
jobs: | ||
release_snapshot_sonatype: | ||
if: "github.event.release.prerelease" | ||
sbt_release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: guardian/actions-sbt-release@v3 | ||
with: | ||
base: main | ||
- uses: actions/setup-java@v3 | ||
with: | ||
distribution: corretto | ||
java-version: 11 | ||
cache: sbt | ||
- name: Release Snapshot (prerelease) to Sonatype | ||
run: | | ||
VERSION=$(git describe --tags | cut -f2 -d"@") | ||
if [[ ${VERSION:0:1} == "v" ]] ; then | ||
VERSION=${VERSION:1} | ||
fi | ||
if [[ ${VERSION: -9} != "-SNAPSHOT" ]] ; then | ||
echo "Version must end in -SNAPSHOT. Adding -SNAPSHOT suffix" | ||
VERSION="$VERSION-SNAPSHOT" | ||
fi | ||
echo $PGP_SECRET | base64 --decode | gpg --batch --import | ||
export GPG_TTY=$(tty) | ||
echo "Releasing version $VERSION Sonatype as snapshot" | ||
yes | sbt -DRELEASE_TYPE=snapshot "clean" "release cross release-version $VERSION with-defaults" | ||
env: | ||
PGP_SECRET: ${{ secrets.PGP_SECRET }} | ||
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} | ||
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | ||
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | ||
fetchDepth: 0 | ||
pgpSecret: ${{ secrets.PGP_SECRET }} | ||
pgpPassphrase: ${{ secrets.PGP_PASSPHRASE }} | ||
sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }} | ||
sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }} | ||
isSnapshot: ${{ github.event.release.prerelease }} |
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
This file was deleted.
Oops, something went wrong.