Skip to content

feat(wallet): Make GH Releases for wallet production releases #8

feat(wallet): Make GH Releases for wallet production releases

feat(wallet): Make GH Releases for wallet production releases #8

name: Build Wallet App (Prod)
on:
push:
tags:
- "wallet-v[0-9]+.[0-9]+.[0-9]+"
env:
DEFAULT_NETWORK: ${{ secrets.WALLET_PROD_DEFAULT_NETWORK }}
IOTA_NETWORKS: ${{ secrets.WALLET_PROD_IOTA_NETWORKS }}
APPS_BACKEND: ${{ secrets.WALLET_PROD_APPS_BACKEND }}
jobs:
wallet-prod-build:
permissions:
contents: read
runs-on: [self-hosted]
steps:
- name: Checking out the repository
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # pin@v3
- uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # [email protected]
- name: Install Nodejs
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # [email protected]
with:
node-version: "20"
cache: "pnpm"
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: get-npm-version
id: package-version
uses: martinbeentjes/npm-get-version-action@3cf273023a0dda27efcd3164bdfb51908dd46a5b # [email protected]
with:
path: apps/wallet
- name: Create artifact name
shell: bash
run: |
export artifact_name="iota-wallet-${{ steps.package-version.outputs.current-version }}"
echo "artifact_name=${artifact_name}" >> $GITHUB_ENV
- name: Build Wallet
run: pnpm wallet build
- name: Get Previous Tag

Check failure on line 41 in .github/workflows/apps_wallet_prod_build.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/apps_wallet_prod_build.yml

Invalid workflow file

You have an error in your yaml syntax on line 41
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:
tag_name: ${{ env.CURRENT_TAG }}
release_name: IOTA Wallet v${{ steps.version.outputs.version }}
body: |
## Changelog
{{ env.changelog }}
draft: false
prerelease: false