-
Notifications
You must be signed in to change notification settings - Fork 102
170 lines (145 loc) · 7.03 KB
/
build-desktop.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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
name: Build Desktop (v2)
on:
workflow_dispatch:
inputs:
os:
description: 'OS'
required: true
type: choice
options:
- macos-11
- ubuntu-20.04
- windows-2019
stage:
description: 'Stage'
required: true
type: choice
options:
- alpha
- beta
- prod
jobs:
build:
runs-on: ${{ matrix.os }}
if: ${{ always() }}
strategy:
matrix:
os: ['${{ inputs.os }}']
fail-fast: true
env:
VERSION: ${{ needs.setup.outputs.version }}
STAGE: ${{ needs.setup.outputs.stage || github.event.inputs.stage }}
steps:
- uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 18.15.0
# Used to read the `binding.gyp` file from `@iota/wallet`
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
- name: Install LLVM and Clang (Windows) # required for bindgen to work, see https://github.com/rust-lang/rust-bindgen/issues/1797
uses: KyleMayes/install-llvm-action@32c4866ebb71e0949e8833eb49beeebed48532bd
if: matrix.os == 'windows-2019'
with:
version: '11.0'
directory: ${{ runner.temp }}/llvm
- name: Set LIBCLANG_PATH (Windows)
run: echo "LIBCLANG_PATH=$((gcm clang).source -replace "clang.exe")" >> $env:GITHUB_ENV
if: matrix.os == 'windows-2019'
- name: Set deployment target (macOS)
run: echo "MACOSX_DEPLOYMENT_TARGET=10.14" >> $GITHUB_ENV # TODO: set this to 10.12 once rocksDB issue is fixed
if: matrix.os == 'macos-11'
- name: Install required packages (Linux)
run: |
sudo apt update
sudo apt install -y gcc-multilib g++-multilib build-essential libssl-dev rpm libsecret-1-dev \
software-properties-common apt-transport-https libudev-dev libusb-1.0-0-dev \
llvm-dev libclang-dev clang
if: matrix.os == 'ubuntu-20.04'
- name: Enable verbose output for electron-builder (macOS/Linux)
run: echo "DEBUG=electron-builder" >> $GITHUB_ENV
if: matrix.os != 'windows-2019'
- name: Enable verbose output for electron-builder (Windows)
run: echo "DEBUG=electron-builder" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
if: matrix.os == 'windows-2019'
- name: Install dependencies
# Increase network timeout threshold to reduce build failures on Windows
run: yarn --network-timeout 1000000
- name: Install Sentry CLI
# Yarn has issues putting binaries in the PATH on Windows
run: npm i -g @sentry/cli
if: ${{ startsWith(github.ref, 'refs/tags/desktop') && matrix.os == 'windows-2019' }}
- name: Set productName
run: node scripts/fix-productName.js
working-directory: packages/desktop
- name: Bundle desktop JS
run: yarn build:${STAGE}
working-directory: packages/desktop
shell: bash
env:
HARDCODE_NODE_ENV: true
SENTRY: ${{ startsWith(github.ref, 'refs/tags/desktop') }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN_PROD_DESKTOP }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
AMPLITUDE_API_KEY: ${{ secrets.AMPLITUDE_API_KEY }}
- name: Build Electron app (macOS)
run: yarn compile:${STAGE}:mac
env:
CSC_LINK: ${{ secrets.MAC_CERT_BASE64 }}
CSC_KEY_PASSWORD: ${{ secrets.MAC_CERT_PASSWORD }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
working-directory: packages/desktop
if: matrix.os == 'macos-11'
- name: Build Electron app (Windows)
run: yarn compile:${env:STAGE}:win
env:
CSC_LINK: ${{ secrets.WIN_CERT_BASE64 }}
CSC_KEY_PASSWORD: ${{ secrets.WIN_CERT_PASSWORD }}
working-directory: packages/desktop
if: matrix.os == 'windows-2019'
- name: Build Electron app (Linux)
run: yarn compile:${STAGE}:linux
working-directory: packages/desktop
if: matrix.os == 'ubuntu-20.04'
- name: Import GPG key (Linux)
run: |
echo "$GPG_PRIVATE_KEY" | base64 -d > /tmp/private.key && \
echo "$GPG_PASSPHRASE" | gpg --batch --yes --passphrase-fd 0 --import /tmp/private.key
env:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
if: matrix.os == 'ubuntu-20.04'
- name: Sign AppImage (Linux)
run: echo $GPG_PASSPHRASE | gpg --pinentry-mode loopback --batch --passphrase-fd 0 --armor --detach-sign --default-key [email protected] firefly-shimmer-desktop*.AppImage
working-directory: packages/desktop/out
env:
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
if: matrix.os == 'ubuntu-20.04'
- name: Compute checksums (Linux)
run: for i in `ls | grep 'firefly-shimmer-desktop*'` ; do sha256sum $i | awk {'print $1'} > $i.sha256 ; done
working-directory: packages/desktop/out
if: matrix.os == 'ubuntu-20.04'
- name: Compute checksums (macOS)
run: for i in `ls | grep 'firefly-shimmer-desktop*'` ; do shasum -a 256 $i | awk {'print $1'} > $i.sha256 ; done
working-directory: packages/desktop/out
if: matrix.os == 'macos-11'
- name: Compute checksums (Windows)
run: Get-ChildItem "." -Filter firefly-shimmer-desktop* | Foreach-Object { $(Get-FileHash -Path $_.FullName -Algorithm SHA256).Hash | Set-Content ($_.FullName + '.sha256') }
working-directory: packages/desktop/out
if: matrix.os == 'windows-2019'
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: firefly-shimmer-desktop-${{ matrix.os }}
path: |
packages/desktop/out/firefly-shimmer-desktop*
packages/desktop/out/shimmer*