forked from crypto-com/chain-desktop-wallet
80 lines (64 loc) · 2.5 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
# Only run on master push
name: Release Executables Binaries
on:
push:
branches:
- master
jobs:
release:
runs-on: ${{ matrix.os }}
environment: deployment
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
steps:
- name: setup dependencies
if: startsWith(matrix.os, 'ubuntu')
run: sudo apt-get update && sudo apt-get install -y libusb-1.0-0-dev libudev-dev
- name: Check out Git repository
uses: actions/checkout@v1
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v1
with:
node-version: 12
- name: Install deps with big timeout
run: |
yarn install --network-timeout 600000
- name: Install Snapcraft
uses: samuelmeuli/action-snapcraft@v1
# Only install Snapcraft on Ubuntu
if: startsWith(matrix.os, 'ubuntu')
with:
# Log in to Snap Store
snapcraft_token: ${{ secrets.snapcraft_token }}
- name: Extract current branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch
- name: Log release reference
run: |
echo "********* START RELEASE REF **********"
echo ${{ github.ref }}
echo ${{ steps.extract_branch.outputs.branch }}
echo "********* END RELEASE REF ************"
- name: Prepare for app notarization (MacOS)
if: startsWith(matrix.os, 'macos')
# Import Apple API key for app notarization on macOS
run: |
mkdir -p ~/private_keys/
echo '${{ secrets.mac_api_key }}' > ~/private_keys/AuthKey_${{ secrets.mac_api_key_id }}.p8
- name: Build/release Electron app
uses: samuelmeuli/action-electron-builder@v1
with:
build_script_name: electron:pre-build
# GitHub token, automatically provided to the action
# (No need to define this secret in the repo settings)
github_token: ${{ secrets.github_token }}
# When a push is done to master, the action builds binaries for all OS and they are then released directly
release: ${{ steps.extract_branch.outputs.branch == 'master' }}
mac_certs: ${{ secrets.mac_certs }}
mac_certs_password: ${{ secrets.mac_certs_password }}
env:
# macOS notarization API key
API_KEY_ID: ${{ secrets.mac_api_key_id }}
API_KEY_ISSUER_ID: ${{ secrets.mac_api_key_issuer_id }}