Skip to content

tag release

tag release #50

Workflow file for this run

name: tag release
on: workflow_dispatch
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin' #Eclipse Temurin
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: deploy
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
MAVEN_GPG_KEY: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} #signer=bc
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
sonar_project_key: "${{ github.repository_owner }}_${{ github.event.repository.name }}"
run: mvn --batch-mode --no-transfer-progress -Pdeploy deploy org.sonarsource.scanner.maven:sonar-maven-plugin:4.0.0.4121:sonar -Dsonar.projectKey=$sonar_project_key
- name: extract version
id: mvnVer
run: echo "version=$(mvn help:evaluate -DforceStdout -Dexpression=project.version -q)" >>$GITHUB_OUTPUT
outputs:
version: ${{ steps.mvnVer.outputs.version }}
release:
needs: deploy
runs-on: ubuntu-latest
if: "!endsWith(needs.deploy.outputs.version, '-SNAPSHOT')"
steps:
- name: release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
branch: "${{ github.ref_name }}"
version: "v${{ needs.deploy.outputs.version }}"
run: gh release create "$version" --repo="$GITHUB_REPOSITORY" --target="$branch" --title="$version" --generate-notes