-
Notifications
You must be signed in to change notification settings - Fork 10
141 lines (120 loc) · 4.23 KB
/
ci.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
name: Build Desktop Wallet
on:
push:
branches: [main, develop]
tags: ['v*']
pull_request:
env:
CARGO_TERM_COLOR: always
jobs:
# Build and package desktop wallet
build:
runs-on: ${{ matrix.runner }}
permissions:
contents: write
env:
# Pin full service binary version
FULL_SERVICE_VERSION: 'v2.10.1'
# Apple codesigning certs
CSC_LINK: ${{ secrets.CSC_LINK }}
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
# AppleID for notarising
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
strategy:
fail-fast: false
matrix:
include:
- runner: ubuntu-latest
os: linux
arch: x64
network: mainnet
- runner: [self-hosted, macOS, X64]
os: mac
arch: x64
network: mainnet
- runner: [self-hosted, macOS, ARM64]
os: mac
arch: arm64
network: mainnet
- runner: ubuntu-latest
os: linux
arch: x64
network: testnet
- runner: [self-hosted, macOS, X64]
os: mac
arch: x64
network: testnet
- runner: [self-hosted, macOS, ARM64]
os: mac
arch: arm64
network: testnet
steps:
- uses: actions/checkout@v2
with:
submodules: true
fetch-depth: 0
- uses: FranzDiebold/[email protected]
- name: Export version tag
run: |
echo "VERSION=$(git describe --dirty=+ --always --tags)" >> $GITHUB_ENV
- name: Configure node
uses: actions/setup-node@v3
with:
node-version: 16
- name: Setup [email protected] for self-hosted runners
# required due to issue with [email protected] and [email protected]
# see: https://stackoverflow.com/questions/74715990/node-gyp-err-invalid-mode-ru-while-trying-to-load-binding-gyp
if: ${{ matrix.os == 'mac' }}
run: |
brew install [email protected]
python3.10 -m venv .venv
echo "$(pwd)/.venv/bin" >> $GITHUB_PATH
- name: Configure node module caching
uses: actions/cache@v3
with:
key: desktop-wallet-${{ matrix.os }}-${{ github.run_id }}
restore-keys: desktop-wallet-${{ matrix.os }}
lookup-only: ${{ matrix.network == 'testnet' }}
path: |
./node_modules
- name: Install node dependencies
uses: borales/actions-yarn@v4
with:
cmd: install
- name: Fetch and link full-service binaries for packaging
run: |
./get-full-service.sh -o ${{ matrix.os }} -a ${{ matrix.arch }} -n ${{ matrix.network }} -v ${{ env.FULL_SERVICE_VERSION }}
cp -r ./full-service-bin/${{ matrix.network }}/* ./full-service-bin/
ls ./full-service-bin/
- name: Patch testnet build names and disable autoupdate
if: ${{ matrix.network == 'testnet' }}
run: |
sed -i.bkp -e's/MobileCoin Wallet/MobileCoin Wallet TestNet/g' package.json
sed -i.bkp -e's/mobilecoin-wallet/mobilecoin-wallet-testnet/g' package.json
sed -i.bkp -e's/MobileCoin Wallet/MobileCoin Wallet TestNet/g' app/package.json
sed -i.bkp -e's/mobilecoin-wallet/mobilecoin-wallet-testnet/g' app/package.json
sed -i.bkp -e's/new AppUpdater();//g' app/main.dev.ts
yarn postinstall
- name: Build and package app
uses: borales/actions-yarn@v4
with:
cmd: package-${{ matrix.os }}
- name: Upload package artifacts
uses: actions/upload-artifact@v3
with:
name: mobilecoin-desktop-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.network }}
path: |
release/MobileCoin Wallet*
release/mobilecoin-wallet*
release/latest-*.yml
- name: Create prerelease for tagged versions
if: startsWith(github.ref, 'refs/tags/v')
uses: softprops/action-gh-release@v1
with:
draft: true
prerelease: true
files: |
release/MobileCoin Wallet*
release/mobilecoin-wallet*