From f2986b26c0530b92e32d36c63c1518043034a0c4 Mon Sep 17 00:00:00 2001 From: sceiler Date: Sun, 20 Mar 2022 01:55:18 +0100 Subject: [PATCH] Add automatically generating changelog and Github release --- .github/workflows/release.yml | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d263389a..2d8709c2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,6 +14,7 @@ jobs: steps: - run: echo "Will start a Maven Central upload with version ${{ github.event.inputs.releaseversion }}" - uses: actions/checkout@v2 + - name: Set up Maven Central Repository uses: actions/setup-java@v2 with: @@ -24,11 +25,42 @@ jobs: server-password: MAVEN_PASSWORD gpg-private-key: ${{ secrets.OSSRH_GPG_SECRET_KEY }} # Value of the GPG private key to import gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase + - name: Set projects Maven version to GitHub Action GUI set version run: mvn versions:set "-DnewVersion=${{ github.event.inputs.releaseversion }}" + - name: Publish package run: mvn -B --no-transfer-progress deploy -DskipTests=true env: MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} - MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} + MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} + + - name: Generate changelog + id: changelog + uses: metcalfc/changelog-generator@v3.0.0 + with: + myToken: ${{ secrets.GITHUB_TOKEN }} + + - name: Create GitHub Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.event.inputs.releaseversion }} + release_name: ${{ github.event.inputs.releaseversion }} + body: | + ``` + + + com.saucelabs + saucerest + ${{ github.event.inputs.releaseversion }} + + + ``` + ### Changelog + ${{ steps.changelog.outputs.changelog }} + draft: false + prerelease: false