-
Notifications
You must be signed in to change notification settings - Fork 96
97 lines (82 loc) · 3.06 KB
/
electron-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
89
90
91
92
93
94
95
96
97
name: 'electron-build'
on:
push:
branches:
- fix-deployment
tags:
- v3.*
jobs:
release:
runs-on: ${{ matrix.os }}
environment: MACOS
strategy:
matrix:
# os: [macos-latest, desktop-build]
os: [desktop-build]
steps:
- name: Check out Git repository
uses: actions/checkout@v3
- name: Read .nvmrc
run: echo ::set-output name=NODE_VERSION::$(cat .nvmrc)
id: nvm
- name: Setup node js runtime
uses: actions/setup-node@v4
with:
node-version: ${{ steps.nvm.outputs.NODE_VERSION }}
- uses: actions/setup-python@v4 #Install awscli on all platform
with:
python-version: '3.10'
- name: Install AWSCLI Package
run: |
python -m pip install --upgrade pip
pip install --upgrade pip
pip install awscli
- name: Configure AWS cli
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_DEFAULT_REGION }}
- name: Download fonts from S3
run: |
aws s3 sync s3://lisk-desktop-files/fonts ./setup/react/assets/fonts/
- name: Update package.json
if: startsWith(matrix.os, 'macos')
run: |
jq '.build.mac.notarize.teamId = "${{ secrets.apple_team_id }}"' package.json > package_temp.json
mv package_temp.json package.json
- name: Install cpx
if: startsWith(matrix.os, 'desktop-build')
run: npm install -g cpx
- name: Prepare for app notarization
if: startsWith(matrix.os, 'macos')
# Import Apple API key for app notarization on macOS
run: |
mkdir -p ~/private_keys/
echo "${{ secrets.api_key_new }}" > ~/private_keys/AuthKey_${{ secrets.api_key_id_new }}.p8
- name: Build and pack windows app
if: startsWith(matrix.os, 'desktop-build')
# codesigning
uses: samuelmeuli/action-electron-builder@v1
with:
build_script_name: pack:win
github_token: ${{ secrets.github_token }}
- name: Build and pack mac app
if: startsWith(matrix.os, 'macos')
uses: samuelmeuli/action-electron-builder@v1
with:
build_script_name: pack
mac_certs: ${{ secrets.mac_certs }}
mac_certs_password: ${{ secrets.mac_certs_password }}
github_token: ${{ secrets.github_token }}
env:
# macOS for notarization API key
API_KEY: ${{ secrets.api_key_new }}
API_KEY_ID: ${{ secrets.api_key_id_new }}
API_KEY_ISSUER_ID: ${{ secrets.api_key_issuer_id }}
APPLE_TEAM_ID: ${{ secrets.apple_team_id }}
- name: Output Notarization Error Log
if: failure() && startsWith(matrix.os, 'macos')
run: |
echo "Notarization failed. Outputting notarization-error.log..."
cat /Users/runner/work/lisk-desktop/lisk-desktop/notarization-error.log