From 492270672ca151f1a7ee6f8bf1f95f160d3ed78e Mon Sep 17 00:00:00 2001 From: James B Date: Mon, 26 Aug 2024 16:09:37 +0200 Subject: [PATCH] Update build pipeline to generate release notes. (#76) --- .github/workflows/GenerateReleaseZip.yml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/GenerateReleaseZip.yml b/.github/workflows/GenerateReleaseZip.yml index 33384f1..7c1fc02 100644 --- a/.github/workflows/GenerateReleaseZip.yml +++ b/.github/workflows/GenerateReleaseZip.yml @@ -96,6 +96,7 @@ jobs: - name: Zip Mod run: | cd $HOME + sudo apt install zip zip -r ./${{ env.MOD_NAME }}.zip ./${{ env.MOD_NAME }}/* - name: Upload Mod Zip Artifact @@ -110,23 +111,30 @@ jobs: needs: package runs-on: ubuntu-latest steps: + + # This extracts the tag name (from github.ref) and uses it as a version - name: Get the Version id: get_version - # This is a special syntax for GitHub Actions that sets an output - # variable. See: https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable run: echo "VERSION=$(echo ${{ github.ref }} | cut -d / -f 3)" >> $GITHUB_OUTPUT + # Set the release name to the mod name and the version from the step above. - name: Set Environment Variables - # This is a special syntax for GitHub Actions that sets an environment - # variable. See: https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable run: echo "MOD_RELEASE=$MOD_NAME-${{ steps.get_version.outputs.VERSION }}" >> $GITHUB_ENV + # Download the build artifact from the package job. - name: Download Mod Artifacts from Build Step id: download_zip uses: actions/download-artifact@v4.1.8 with: name: ${{ env.MOD_NAME }} + # Auto-generate changelog. + - name: Build Changelog + id: github_release + uses: mikepenz/release-changelog-builder-action@v5 + env: + GITHUB_TOKEN: ${{ secrets.CI_TOKEN }} + - name: Create Release id: create_release uses: actions/create-release@v1.1.4 @@ -135,6 +143,7 @@ jobs: with: tag_name: ${{ github.ref }} release_name: ${{ env.MOD_RELEASE }} + body: ${{ steps.github_release.outputs.changelog }} # These can be configured at the top of the workflow. draft: ${{ env.RELEASE_DRAFT }} prerelease: ${{ env.RELEASE_PRERELEASE }}