From 705d4c9d8bb8ab4333e6464aa9e9fb508b45e894 Mon Sep 17 00:00:00 2001 From: marc2332 Date: Thu, 7 Nov 2024 16:56:02 +0100 Subject: [PATCH] feat(wallet): Make GH Releases for wallet production releases --- .github/workflows/apps_wallet_prod_build.yml | 46 +++++++++++++++++--- 1 file changed, 41 insertions(+), 5 deletions(-) diff --git a/.github/workflows/apps_wallet_prod_build.yml b/.github/workflows/apps_wallet_prod_build.yml index 24c4cecc424..371fa0fbf46 100644 --- a/.github/workflows/apps_wallet_prod_build.yml +++ b/.github/workflows/apps_wallet_prod_build.yml @@ -38,9 +38,45 @@ jobs: echo "artifact_name=${artifact_name}" >> $GITHUB_ENV - name: Build Wallet run: pnpm wallet build - - name: Upload artifacts - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # pin@v4 + - name: Get Previous Tag + id: prev_tag + run: | + tags=$(git tag --list 'wallet-v*.*.*' --sort=-creatordate) + current_tag=$(echo "$tags" | sed -n 1p) + prev_tag=$(echo "$tags" | sed -n 2p) + if [ -z "$prev_tag" ]; then + echo "No previous tag found. Skipping changelog generation." + echo "PREV_TAG=none" >> $GITHUB_ENV + else + echo "PREV_TAG=$prev_tag" >> $GITHUB_ENV + fi + echo "CURRENT_TAG=$current_tag" >> $GITHUB_ENV + + - name: Generate Changelog + id: generate_changelog + run: | + if [ "${{ env.PREV_TAG }}" = "none" ]; then + echo "No previous tag found. Skipping changelog generation." + echo "changelog=No previous tag found. Changelog generation skipped." >> $GITHUB_ENV + else + git log ${{ env.PREV_TAG }}..${{ env.CURRENT_TAG }} --pretty=format:"- %s by @%an in #%h" -- ./apps/wallet > CHANGELOG.md + changelog=$(cat CHANGELOG.md) + echo "changelog=$changelog" >> $GITHUB_ENV + fi + + - name: Get version from tag + id: version + run: echo "::set-output name=version::${GITHUB_REF#refs/tags/wallet-v}" + + - name: Create GitHub Release + uses: elgohr/create-release@v5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - name: ${{ env.artifact_name }} - path: | - ./apps/wallet/dist + tag_name: ${{ env.CURRENT_TAG }} + release_name: IOTA Wallet v${{ steps.version.outputs.version }} + body: | + ## Changelog + {{ env.changelog }} + draft: false + prerelease: false \ No newline at end of file