Skip to content

Commit

Permalink
fix: release workflow was missing
Browse files Browse the repository at this point in the history
  • Loading branch information
sephiroth-j committed Sep 20, 2024
1 parent 056f6d8 commit 7b33da3
Showing 1 changed file with 72 additions and 0 deletions.
72 changes: 72 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: perform release

on:
workflow_dispatch:
inputs:
release_version:
description: 'The new version to be set. Leave it empty if you want Maven to set the next version automatically.'
required: false
type: string

permissions:
checks: read
contents: write

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 11
distribution: 'zulu'
cache: 'maven'
server-id: 'maven.jenkins-ci.org'
server-username: 'MAVEN_USERNAME'
server-password: 'MAVEN_TOKEN'

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts/*'

- name: Configure Git User
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: perform release
run: mvn -B -DskipTests -Dspotbugs.skip=true -DreleaseVersion=${{ inputs.release_version }} -Darguments="-DskipTests -Dspotbugs.skip=true" release:prepare release:perform
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MAVEN_TOKEN: ${{ secrets.MAVEN_TOKEN }}
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}

- name: extract version
id: current_version
shell: bash
run: |
echo "version=$(mvn -q -f target/checkout/pom.xml -DforceStdout help:evaluate -Dexpression=project.version)" >> $GITHUB_OUTPUT
- name: Get Changelog Entry
id: changelog_reader
uses: mindsers/changelog-reader-action@v2
with:
validation_level: none
version: v${{ steps.current_version.outputs.version }}
path: ./CHANGELOG.md

- name: Create Release
uses: ncipollo/[email protected]
with:
artifacts: target/checkout/target/dependency-track.hpi
artifactContentType: application/zip
draft: false
tag: v${{ steps.current_version.outputs.version }}
body: ${{ steps.changelog_reader.outputs.changes }}
token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 7b33da3

Please sign in to comment.