Update GitHub Actions - build.yml
and release.yml
: Replace `actio…
#126
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 | |
on: | |
push: | |
branches: | |
- master | |
tags: | |
- '*' | |
env: | |
GH_JAVA_VERSION: "11" | |
GH_JAVA_DISTRIBUTION: "temurin" | |
jobs: | |
build_and_publish: | |
if: github.repository == 'hedgehogqa/scala-hedgehog' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-java@v4 | |
with: | |
java-version: ${{ env.GH_JAVA_VERSION }} | |
distribution: ${{ env.GH_JAVA_DISTRIBUTION }} | |
cache: 'sbt' | |
- uses: olafurpg/setup-gpg@v3 | |
- name: "sbt ci-release (non-tag) - ${{ github.run_number }}" | |
if: startsWith(github.ref, 'refs/heads/') | |
env: | |
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} | |
PGP_SECRET: ${{ secrets.PGP_SECRET }} | |
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | |
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | |
run: | | |
export CURRENT_BRANCH_NAME="${GITHUB_REF#refs/heads/}" | |
export PROJECT_VERSION=$(git log --format=%H -1) | |
.github/workflows/publish.sh | |
- name: "sbt ci-release (tag) - ${{ github.run_number }}" | |
if: startsWith(github.ref, 'refs/tags/v') | |
env: | |
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} | |
PGP_SECRET: ${{ secrets.PGP_SECRET }} | |
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | |
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | |
run: | | |
export GITHUB_TAG=${GITHUB_REF#refs/tags/} | |
export PROJECT_VERSION=$(echo "$GITHUB_TAG" | sed 's/^v//') | |
.github/workflows/publish.sh |