-
Notifications
You must be signed in to change notification settings - Fork 67
190 lines (184 loc) · 6.83 KB
/
on-push-pyinstaller.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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
name: Pyinstaller (on_push)
on:
push:
paths:
- .github/scripts/cicd/build_pyinstaller.sh
- .github/workflows/on-push-pyinstaller.yml
- runway/*
- poetry.lock
- pyproject.toml
- runway.file.spec
- runway.folder.spec
env:
AWS_DEFAULT_REGION: us-east-1
jobs:
build-pyinstaller-onefile:
name: Pyinstaller "One File" Build
strategy:
matrix:
os: [macos-12, ubuntu-latest, windows-latest]
python-version: [3.9]
runs-on: ${{ matrix.os }}
env:
OS_NAME: ${{ matrix.os }}
# pydantic binary causes a recursion error
# https://github.com/pyinstaller/pyinstaller/issues/4406
PIP_NO_BINARY: pydantic
steps:
- name: ⤵️ Check out code from GitHub (complete)
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: 🏗 Setup Python
uses: finleyfamily/[email protected]
with:
poetry-install: false
poetry-plugins: poetry-dynamic-versioning
python-version: ${{ matrix.python-version }}
# Remove apt repos that are known to break from time to time
# See https://github.com/actions/virtual-environments/issues/323
- name: Remove broken apt repos (ubuntu)
if: startsWith( matrix.os, 'ubuntu' )
run: |
for apt_file in `grep -lr microsoft /etc/apt/sources.list.d/`; do sudo rm $apt_file; done
- name: ⤵️ Install Dependencies (ubuntu)
if: startsWith( matrix.os, 'ubuntu' )
run: sudo apt-get update && sudo apt-get install sed -y
- name: ⤵️ Install Dependencies (windows)
if: matrix.os == 'windows-latest'
run: choco install make sed
- name: 👷 Build
run: make build-pyinstaller-file
- name: ⤴️ Upload distribution artifact
uses: actions/upload-artifact@v4
with:
name: pyinstaller-onefile-${{ matrix.os }}
path: artifacts
build-pyinstaller-onefolder:
name: Pyinstaller "One Folder" Build
strategy:
matrix:
os: [macos-12, ubuntu-latest, windows-latest]
python-version: [3.9]
runs-on: ${{ matrix.os }}
env:
OS_NAME: ${{ matrix.os }}
# pydantic binary causes a recursion error
# https://github.com/pyinstaller/pyinstaller/issues/4406
PIP_NO_BINARY: pydantic
steps:
- name: ⤵️ Check out code from GitHub (complete)
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: 🏗 Setup Python
uses: finleyfamily/[email protected]
with:
poetry-install: false
poetry-plugins: poetry-dynamic-versioning
python-version: ${{ matrix.python-version }}
# Remove apt repos that are known to break from time to time
# See https://github.com/actions/virtual-environments/issues/323
- name: Remove broken apt repos (ubuntu)
if: startsWith( matrix.os, 'ubuntu' )
run: |
for apt_file in `grep -lr microsoft /etc/apt/sources.list.d/`; do sudo rm $apt_file; done
- name: ⤵️ Dependencies (ubuntu)
if: startsWith( matrix.os, 'ubuntu' )
run: sudo apt-get update && sudo apt-get install sed -y
- name: ⤵️ Install Dependencies (windows)
if: matrix.os == 'windows-latest'
run: choco install make sed
- name: 👷 Build
run: make build-pyinstaller-folder
- name: ⤴️ Upload distribution artifact
uses: actions/upload-artifact@v4
with:
name: pyinstaller-onefolder-${{ matrix.os }}
path: artifacts
build-npm:
name: Build npm 📦
if: github.ref == 'refs/heads/master'
needs:
- build-pyinstaller-onefolder
env:
NODE_VERSION: 20
NPM_PACKAGE_NAME: '@onica/runway'
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: [3.9]
runs-on: ${{ matrix.os }}
steps:
- name: ⤵️ Check out code from GitHub (complete)
uses: actions/checkout@v4
with:
fetch-depth: 0
- id: check_distance
name: 💂 Ensure Commit Is Not Tagged
continue-on-error: true
run: bash ./check_distance_from_tag.sh
working-directory: .github/scripts/cicd
- name: 🏗 Setup Python
uses: finleyfamily/[email protected]
with:
poetry-install: false
poetry-plugins: poetry-dynamic-versioning
python-version: ${{ matrix.python-version }}
- name: 🏗 Setup Node
uses: actions/setup-node@v4
if: steps.check_distance.outcome == 'success'
with:
always-auth: true
node-version: ${{ env.NODE_VERSION }}
registry-url: https://registry.npmjs.org
scope: '@onica'
# Remove apt repos that are known to break from time to time
# See https://github.com/actions/virtual-environments/issues/323
- name: Remove broken apt repos (ubuntu)
if: startsWith( matrix.os, 'ubuntu' )
run: |
for apt_file in `grep -lr microsoft /etc/apt/sources.list.d/`; do sudo rm $apt_file; done
- name: ⤵️ Install Dependencies (ubuntu)
if: steps.check_distance.outcome == 'success'
run: sudo apt-get update && sudo apt-get install sed tree -y
- name: ⤵️ Download distribution artifacts (macOS)
if: steps.check_distance.outcome == 'success'
uses: actions/download-artifact@v4
with:
name: pyinstaller-onefolder-macos-12
path: artifacts
- name: ⤵️ Download distribution artifacts (ubuntu)
if: steps.check_distance.outcome == 'success'
uses: actions/download-artifact@v4
with:
name: pyinstaller-onefolder-ubuntu-latest
path: artifacts
- name: ⤵️ Download distribution artifacts (windows)
if: steps.check_distance.outcome == 'success'
uses: actions/download-artifact@v4
with:
name: pyinstaller-onefolder-windows-latest
path: artifacts
- name: ℹ️ List artifacts
if: steps.check_distance.outcome == 'success'
run: tree artifacts/
- name: 👷 npm Prep
if: steps.check_distance.outcome == 'success'
run: make npm-prep
- name: 👷 Build
if: steps.check_distance.outcome == 'success'
run: |
npm pack
rm -rf artifacts && mkdir -p artifacts
find . -name 'onica-runway-*.*.*.tgz' -exec mv {} artifacts/ \;
- name: ℹ️ Skipped Publishing
if: steps.check_distance.outcome == 'failure'
run: echo "A pre-production version was not published because the current commit is tagged for release."
- name: ⤴️ Upload distribution artifacts
if: steps.check_distance.outcome == 'success'
uses: actions/upload-artifact@v4
with:
name: npm-pack
path: artifacts