-
Notifications
You must be signed in to change notification settings - Fork 445
133 lines (115 loc) · 4.05 KB
/
build_windows.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
name: Windows
on:
workflow_call:
inputs:
os:
default: windows-latest
type: string
required: false
python-version:
default: 3.8
type: string
required: false
upload:
default: false
type: boolean
required: false
workflow_dispatch:
inputs:
os:
description: Environment
default: windows-latest
type: string
required: true
python-version:
description: Python version
default: '3.8'
type: string
required: true
upload:
description: Upload
default: true
type: boolean
required: true
jobs:
build:
environment: build
runs-on: ${{ github.event.inputs.os || inputs.os }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{github.event.pull_request.head.sha}}
- name: Modify PATH
run: |
echo "C:\msys64\usr\bin" >> $env:GITHUB_PATH
echo "C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64" >> $env:GITHUB_PATH
- uses: actions/setup-python@v3
with:
python-version: ${{ github.event.inputs.python-version || inputs.python-version }}
- name: Save Git info
run: |
git describe | python -c "import sys; print(next(sys.stdin).lstrip('v'))" > .TriblerVersion
git rev-parse HEAD > .TriblerCommit
- name: Install windows dependencies
uses: ./.github/actions/windows_dependencies
- name: Restore certificate
shell: bash
env:
CERTIFICATE_BASE64: ${{ secrets.WINDOWS_CERTIFICATE }}
run: |
echo $CERTIFICATE_BASE64 | base64 --decode > certificate.pfx
ls -l certificate.pfx
- name: Prepare files
env:
SENTRY_URL: ${{secrets.SENTRY_URL}}
shell: cmd
run: |
python ./build/update_version.py -r .
python ./build/win/replace_nsi.py -r . --architecture x64
- name: Collect required binaries
shell: cmd
run: |
mkdir C:\build\certs
wget -q https://download.microsoft.com/download/9/3/F/93FCF1E7-E6A4-478B-96E7-D4B285925B00/vc_redist.x64.exe
move vc_redist.x64.exe C:\build\vc_redist_140.exe
copy C:\Windows\system32\libsodium.dll C:\build\
move certificate.pfx C:\build\certs\
- name: Install NSIS plugins
env:
NSIS_PLUGINS: C:\Program Files (x86)\NSIS\Plugins
NSIS_INCLUDE: C:\Program Files (x86)\NSIS\Include
shell: cmd
run: |
wget -q https://nsis.sourceforge.io/mediawiki/images/1/18/NsProcess.zip
7z x NsProcess.zip -oNsProcess
move .\NsProcess\Plugin\nsProcessW.dll "%NSIS_PLUGINS%\x86-unicode\nsProcess.dll"
move .\NsProcess\Plugin\nsProcess.dll "%NSIS_PLUGINS%\x86-ansi\nsProcess.dll"
move .\NsProcess\Include\* "%NSIS_INCLUDE%"
echo AccessControl
wget -q https://nsis.sourceforge.io/mediawiki/images/4/4a/AccessControl.zip
7z x AccessControl.zip -oAccessControl
move .\AccessControl\Plugins\i386-unicode\* "%NSIS_PLUGINS%\x86-unicode"
move .\AccessControl\Plugins\i386-ansi\* "%NSIS_PLUGINS%\x86-ansi"
echo NSIS_Simple_Firewall_Plugin
wget -q https://nsis.sourceforge.io/mediawiki/images/e/e0/NSIS_Simple_Firewall_Plugin_Unicode_1.21.zip
7z x NSIS_Simple_Firewall_Plugin_Unicode_1.21.zip -oSFP
move .\SFP\SimpleFC.dll "%NSIS_PLUGINS%\x86-unicode"
- name: Run build script
timeout-minutes: 10
env:
QT_QPA_PLATFORM: offscreen
QT_ACCESSIBILITY: 1
QT_IM_MODULE: ibus
LOG_LEVEL: INFO
PASSWORD: ${{ secrets.CERTIFICATE_PASSWORD }}
shell: cmd
run: |
./build/win/makedist_win.bat
- name: Upload Artifact
if: github.event.inputs.upload || inputs.upload
uses: actions/upload-artifact@v3
with:
name: tribler
path: dist/
retention-days: 1