forked from Flax-Network/flax-blockchain
-
Notifications
You must be signed in to change notification settings - Fork 8
100 lines (86 loc) · 2.99 KB
/
build-windows-installer.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
name: Windows Installer on Windows 10 and Python 3.7
on:
push:
branches:
- main
tags:
- '**'
pull_request:
branches:
- '**'
jobs:
build:
name: Windows Installer on Windows 10 and Python 3.7
runs-on: [windows-latest]
timeout-minutes: 40
steps:
- name: Cancel previous runs on the same branch
if: ${{ github.ref != 'refs/heads/main' }}
uses: styfle/cancel-workflow-action@0.9.0
with:
access_token: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout Code
uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: recursive
- name: Get npm cache directory
id: npm-cache
run: |
echo "::set-output name=dir::$(npm config get cache)"
- name: Cache npm
uses: actions/cache@v2.1.5
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Get pip cache dir
id: pip-cache
run: |
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache pip
uses: actions/cache@v2.1.5
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
restore-keys: |
${{ runner.os }}-pip-
# We can't upgrade to Python 3.8 until we have a miniupnpc binary
- uses: actions/setup-python@v2
name: Install Python 3.7
with:
python-version: "3.7"
- name: Test for secrets access
id: check_secrets
shell: bash
run: |
unset HAS_SECRET
if [ -n "$SECRET" ]; then HAS_SECRET='true' ; fi
echo ::set-output name=HAS_SECRET::${HAS_SECRET}
env:
SECRET: "${{ secrets.WIN_CODE_SIGN_CERT }}"
- name: Decode code signing cert into an encrypted file
if: steps.check_secrets.outputs.HAS_SECRET
uses: kitek/decode-base64-into-file-action@1.0
with:
encoded-value: ${{ secrets.WIN_CODE_SIGN_CERT }}
destination-file: .\dogechia-blockchain-gui\win_code_sign_cert.p12
- name: Build Windows installer with build_scripts\build_windows.ps1
env:
WIN_CODE_SIGN_PASS: ${{ secrets.WIN_CODE_SIGN_PASS }}
HAS_SECRET: ${{ steps.check_secrets.outputs.HAS_SECRET }}
run: |
$env:path="C:\Program` Files` (x86)\Microsoft` Visual` Studio\2019\Enterprise\SDK\ScopeCppSDK\vc15\VC\bin\;$env:path"
$env:path="C:\Program` Files` (x86)\Windows` Kits\10\App` Certification` Kit;$env:path"
.\build_scripts\build_windows.ps1
- name: Upload Windows exe's to artifacts
uses: actions/upload-artifact@v2.2.2
with:
name: Windows-Exe
path: ${{ github.workspace }}\dogechia-blockchain-gui\DogeChia-win32-x64\
- name: Upload Installer to artifacts
uses: actions/upload-artifact@v2.2.2
with:
name: Windows-Installers
path: ${{ github.workspace }}\dogechia-blockchain-gui\release-builds\