Skip to content

Release

Release #26

Workflow file for this run

name: Release
on:
workflow_run:
workflows: [Java CI]
types: [completed]
permissions:
contents: write
jobs:
on-success:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- uses: actions/[email protected]
- name: Set up JDK
uses: actions/[email protected]
with:
java-version: 17
distribution: adopt
- name: Get project version and artifact id
id: project
run: |
VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
echo "version=$PROJECT_VERSION" >> $GITHUB_OUTPUT
ARTIFACT=$(mvn help:evaluate -Dexpression=project.artifactId -q -DforceStdout)
echo "artifact=$ARTIFACT" >> $GITHUB_OUTPUT
- name: conventional Changelog Action
id: changelog
uses: TriPSs/conventional-changelog-action@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
skip-version-file: true
- name: Update pom.xml version
if: steps.changelog.outputs.skipped == 'false'
run: |
mvn versions:set -DnewVersion=${{ steps.changelog.outputs.version }}
mvn versions:commit
git config --global user.name 'VoperAD'
git config --global user.email '[email protected]'
git commit -am "chore: bump project version to ${{ steps.changelog.outputs.version }} [skip ci]"
git push
- name: generate jar
if: steps.changelog.outputs.skipped == 'false'
run: |
mvn package
- name: create release with last commit
if: steps.changelog.outputs.skipped == 'false'
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.changelog.outputs.tag }}
name: ${{ steps.changelog.outputs.tag }}
body: ${{ steps.changelog.outputs.clean_changelog }}
artifacts: "target/${{ steps.project.outputs.artifact }}-${{ steps.changelog.outputs.version }}.jar"
on-failure:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
steps:
- run: echo 'The triggering workflow failed'