-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
81 lines (75 loc) · 2.23 KB
/
action.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
name: nw-build
description: Build distributions of apps based on NW framework
author: Spherical
inputs:
app:
description: Package name of the app to build
required: true
plugins:
description: Requirements to add while packaging
required: false
index:
description: Python package index with extra packages
required: true
cert-pass:
description: Certificate password
required: true
outputs:
target-file:
description: Build result file
value: ${{ steps.build-target.outputs.target-file }}
runs:
using: composite
steps:
-
name: Install choco
run: |
Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Force
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12;
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
shell: pwsh
-
name: Install non-python dependencies
run: |
choco install -y imagemagick --side-by-side --version=7.0.11.14 2>&1 >>build.log
shell: pwsh
-
name: Add PATH for non-python dependencies
run: |
echo "C:\Program Files\ImageMagick-7.0.11-Q16-HDRI" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
shell: pwsh
-
name: Install python prerequisites
run: |
pip install wheel
python -m pip install pip==20.3.4 'setuptools>=40.4.3,<61'
shell: pwsh
-
name: Install nw-builder
env:
PIP_EXTRA_INDEX_URL: '${{ inputs.index }}'
run: pip install --no-use-pep517 nw-builder
shell: pwsh
-
name: Build the target app
env:
PIP_EXTRA_INDEX_URL: '${{ inputs.index }}'
run: |
import subprocess
print('Building ${{ inputs.app }}')
plugins = '${{ inputs.plugins }}'
if plugins:
plugins = ' '.join(('-l', *plugins.split()))
subprocess.check_call((
*'nw build -p'.split(),
'${{ inputs.app }}',
'-c', '${{ inputs.cert-pass }}',
*plugins.split(),
))
shell: python
-
name: Build target
id: build-target
run: |
echo "target-file=$(Get-ChildItem -Path *.exe -Name)" >> $GITHUB_OUTPUT
shell: pwsh