-
Notifications
You must be signed in to change notification settings - Fork 35
122 lines (113 loc) · 4.01 KB
/
release.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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
name: on_pr_edit
run-name: 'release: ${{ github.ref_name }}'
on:
workflow_dispatch:
pull_request:
# TODO I'll probably need permission to publish a new release.
permissions:
id-token: write
contents: read
env:
DMG_FILENAME: "Wallet Recovery Wizard.dmg"
EXE_FILENAME: "Wallet Recovery Wizard.exe"
DEB_FILENAME: "Wallet Recovery Wizard.deb"
jobs:
get-current-version:
name: Get the current version
runs-on: ubuntu-latest
outputs:
current_version: ${{ steps.get-current-version.outputs.current_version }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- id: get-current-version
run: |
latest_tag=$(git describe --abbrev=0 --tags | sed "s/v//g")
echo "current_version=$latest_tag" >> "$GITHUB_OUTPUT"
# TODO move this to the summary.
echo "Latest version is $latest_tag"
create-new-release-temp:
name: Get the current version
runs-on: ubuntu-latest
needs:
- get-current-version
steps:
- id: get-current-version
run: |
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ github.token }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/BitGo/wallet-recovery-wizard/releases \
-d '{"tag_name":"v9.9.9999","target_commitish":"master","name":"v9.9.9999","body":"Description of the release","draft":true,"generate_release_notes":true}'
exit 1
mac-build:
name: Create Mac release
runs-on: macos-latest
needs:
- get-current-version
- create-new-release-temp
env:
CURRENT_VERSION: "${{ needs.get-current-version.outputs.current_version }}"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
cache: 'npm'
# TODO we should pin that version in the package-lock
- run: npm install dmg-license
- run: npm run build
- uses: actions/upload-artifact@v4
with:
name: "Wallet Recovery Wizard.dmg"
path: "release/${{ env.CURRENT_VERSION }}/Wallet Recovery Wizard-${{ env.CURRENT_VERSION }}.dmg"
if-no-files-found: "error"
windows-linux-build:
name: Create Windows and Linux release
runs-on: ubuntu-latest
needs:
- get-current-version
- create-new-release-temp
env:
CURRENT_VERSION: "${{ needs.get-current-version.outputs.current_version }}"
container:
# TODO sha-pin this image
image: electronuserland/builder:16-wine
steps:
- uses: actions/checkout@v4
- run: npm install
- run: npm run build -- -wl
- uses: actions/upload-artifact@v4
with:
name: "Wallet Recovery Wizard.exe"
path: "release/${{ env.CURRENT_VERSION }}/Wallet Recovery Wizard-Setup-${{ env.CURRENT_VERSION }}.exe"
if-no-files-found: "error"
- uses: actions/upload-artifact@v4
with:
name: "Wallet Recovery Wizard.deb"
path: "release/${{ env.CURRENT_VERSION }}/Wallet Recovery Wizard-Linux-${{ env.CURRENT_VERSION }}.deb"
if-no-files-found: "error"
create-new-release:
name: Create a new GitHub release
runs-on: ubuntu-latest
needs:
- mac-build
- windows-linux-build
env:
CURRENT_VERSION: "${{ needs.get-current-version.outputs.current_version }}"
container:
# TODO sha-pin this image
image: electronuserland/builder:16-wine
steps:
- uses: actions/download-artifact@v4
with:
# We don't want to download the artifacts to separate directories,
# we want to download them to the same directory instead.
merge-multiple: true
- run: |
sha256sum "${{ env.DEB_FILENAME }}" > "${{ env.DEB_FILENAME }}.sha256sum"
sha256sum "${{ env.EXE_FILENAME }}" > "${{ env.EXE_FILENAME }}.sha256sum"
sha256sum "${{ env.DMG_FILENAME }}" > "${{ env.DMG_FILENAME }}.sha256sum"