Bump flexy-pool from 2.2.3 to 3.0.0 #22
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: Build | |
on: | |
push: | |
branches: | |
- master | |
tags-ignore: | |
- '*' | |
pull_request: | |
branches: | |
- master | |
workflow_dispatch: | |
concurrency: | |
# On master, we don't want any jobs cancelled so the sha is used to name the group | |
# On PR branches, we cancel the job if new commits are pushed | |
# More info: https://stackoverflow.com/a/68422069/253468 | |
group: ${{ (github.ref == 'refs/heads/master') && format('{0}-{1}', github.workflow_ref, github.sha) || format('{0}-{1}', github.workflow_ref, github.head_ref) }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
checks: write # for publishing test results and annotations | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
cache: 'gradle' | |
- id: get-snapshot-version | |
name: Generate snapshot version | |
shell: bash | |
run: | | |
# expects git tag to be in format 'v0.1.0' or 'v0.1.0-rc1' | |
version=$(git describe --tag --abbrev=0 | cut -c 2-) | |
regex="^([0-9]+)\.([0-9]+)\.([0-9]+)(-[a-zA-Z0-9]+)?$" | |
if [[ $version =~ $regex ]]; then | |
major="${BASH_REMATCH[1]}" | |
minor="${BASH_REMATCH[2]}" | |
patch="${BASH_REMATCH[3]}" | |
pre_release="${BASH_REMATCH[4]:-}" | |
# increment patch version of the latest release to create new snapshot version | |
# when pre-release - continue snapshots of the same version | |
# v0.1.0 -> 0.1.0-SNAPSHOT | |
# v0.1.0-rc -> 0.1.0-SNAPSHOT | |
if [[ -z $pre_release ]]; then | |
patch=$(($patch + 1)) | |
fi | |
snapshot_version="${major}.${minor}.${patch}" | |
if ! [[ $snapshot_version =~ $regex ]]; then | |
echo "SNAPSHOT version $snapshot_version is not a valid SemVer" | |
exit 1 | |
fi | |
echo "${snapshot_version}-SNAPSHOT" | |
echo "snapshot-version=${snapshot_version}-SNAPSHOT" >> $GITHUB_OUTPUT | |
else | |
echo "Version $version is not a valid SemVer" | |
exit 1 | |
fi | |
- name: Build | |
run: | | |
./gradlew \ | |
-Pversion=${{ steps.get-snapshot-version.outputs.snapshot-version }} \ | |
build | |
- name: Publish Test Report | |
uses: mikepenz/action-junit-report@v4 | |
if: ${{ !cancelled() }} # always run even if the previous step fails | |
with: | |
report_paths: '**/build/test-results/test/TEST-*.xml' | |
- name: Upload SNAPSHOT artifacts to Sonatype | |
id: upload_snapshot_artifacts | |
if: ${{ github.ref == 'refs/heads/master' }} | |
env: | |
SONATYPE_USER: ${{ secrets.SONATYPE_USER }} | |
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | |
GPG_KEY: ${{ secrets.GPG_KEY }} | |
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | |
run: | | |
./gradlew \ | |
-Pversion=${{ steps.get-snapshot-version.outputs.snapshot-version }} \ | |
publishToSonatype closeAndReleaseSonatypeStagingRepository |