Skip to content

Commit

Permalink
Add release pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
bdhoine committed Oct 15, 2024
1 parent 03f0a1b commit ef9bb7e
Showing 1 changed file with 4 additions and 56 deletions.
60 changes: 4 additions & 56 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,13 @@ on:
required: false
default: true
type: boolean
github:
description: Create GitHub release
required: false
default: true
type: boolean
push:
description: Push changes
required: false
default: true
type: boolean

permissions:
contents: write

jobs:
release:
name: Maven and GitHub Release
name: Maven Release
runs-on: ubuntu-latest

steps:
Expand All @@ -44,56 +34,14 @@ jobs:
gpg-passphrase: MAVEN_GPG_PASSPHRASE

- name: Remove SNAPSHOT from version
run: mvn --batch-mode versions:set -DremoveSnapshot versions:commit

- name: Set RELEASE_VERSION environment variable
run: |
echo "RELEASE_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV
- name: Update CHANGELOG.md
uses: thomaseizinger/keep-a-changelog-new-release@v3
with:
tag: ${{ env.RELEASE_VERSION }}

- name: Query release info
id: query-release-info
uses: release-flow/keep-a-changelog-action@v3
with:
command: query
version: latest
mvn --batch-mode versions:set -DremoveSnapshot versions:commit
find . -name "pom.xml" -exec sed -i "" 's#.0000-SNAPSHOT#.0000#g' {} +
- name: Deploy package
if: ${{ inputs.central }}
run: mvn --batch-mode deploy --activate-profiles release
env:
MAVEN_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}

- name: Commit and push release
if: ${{ inputs.push }}
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Create release ${{ steps.query-release-info.outputs.version }}"
tagging_message: ${{ steps.query-release-info.outputs.version }}

- name: Create release
if: ${{ inputs.github }}
uses: softprops/action-gh-release@v2
with:
name: ${{ steps.update-query-release-info.outputs.version }}
tag_name: ${{ steps.query-release-info.outputs.version }}
body: ${{ steps.query-release-info.outputs.release-notes }}

- name: Next SNAPSHOT version
run: mvn --batch-mode versions:set -DnextSnapshot versions:commit

- name: Set RELEASE_VERSION env variable
run: |
echo "RELEASE_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV
- name: Commit and push development version
if: ${{ inputs.push }}
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "Bump development version to ${{ env.RELEASE_VERSION }}"
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}

0 comments on commit ef9bb7e

Please sign in to comment.