Build Wallet App (Prod) #17
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Wallet App (Prod) | |
on: | |
workflow_dispatch: | |
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 }} | |
SENTRY_AUTH_TOKEN: ${{ secrets.TOOLING_SENTRY_AUTH_TOKEN }} | |
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 | |
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_OUTPUT | |
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_OUTPUT | |
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: softprops/action-gh-release@01570a1f39cb168c169c802c3bceb9e93fb10974 # [email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
CHANGELOG: ${{ steps.generate_changelog.outputs.changelog }} | |
with: | |
tag_name: ${{ env.CURRENT_TAG }} | |
name: IOTA Wallet v${{ steps.version.outputs.version }} | |
body: | | |
## Changelog | |
{{ env.CHANGELOG }} | |
draft: true | |
prerelease: false | |
- name: Upload artifacts | |
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # pin@v4 | |
with: | |
name: ${{ env.artifact_name }} | |
path: | | |
./apps/wallet/dist |