Skip to content

Deploy

Deploy #60

Workflow file for this run

name: Deploy
on:
push:
tags:
- '*.*.*'
jobs:
deploy:
runs-on: macos-latest
env:
SONA_USER: ${{ secrets.SONA_USER }}
SONA_PASS: ${{ secrets.SONA_PASS }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SONA_PGP_PASSPHRASE }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SONA_PGP_SECRET }}
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
- name: Build
run: ./gradlew assembleRelease
- name: Get tag and tracker version information
id: version
run: |
echo ::set-output name=TAG_VERSION::${GITHUB_REF#refs/*/}
echo "##[set-output name=TRACKER_VERSION;]$(cat VERSION)"
- name: Fail if version mismatch
if: ${{ steps.version.outputs.TAG_VERSION != steps.version.outputs.TRACKER_VERSION }}
run: |
echo "Tag version (${{ steps.version.outputs.TAG_VERSION }}) doesn't match version in project (${{ steps.version.outputs.TRACKER_VERSION }})"
exit 1
- name: Publish
run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository