-
Notifications
You must be signed in to change notification settings - Fork 13
88 lines (81 loc) · 3.14 KB
/
apps_wallet_prod_build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
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: write
runs-on: [self-hosted]
steps:
- name: Checking out the repository
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
- uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0
- name: Install Nodejs
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
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 # v1.3.1
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
echo "## Changelog" >> CHANGELOG.md
git log ${{ env.PREV_TAG }}..${{ env.CURRENT_TAG }} --pretty=format:"- %s in #%h" -- ./apps/wallet > CHANGELOG.md
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 # v2.1.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.CURRENT_TAG }}
name: IOTA Wallet v${{ steps.version.outputs.version }}
draft: true
prerelease: false
body_path: CHANGELOG.md
- name: Upload artifacts
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: ${{ env.artifact_name }}
path: |
./apps/wallet/dist