-
Notifications
You must be signed in to change notification settings - Fork 5
193 lines (158 loc) · 6.46 KB
/
release_testing.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
191
192
193
name: release_testing
env:
PYTHON_VERSION_BUMP: "3.10"
PYTHON_VERSION_BUILD_EXES: "3.10"
PYTHON_VERSION_RELEASE: "3.10"
PYTHON_VERSION_BUILD_DOCS: "3.10"
PYTHON_VERSION_UPDATE_WEB: "3.10"
on:
workflow_dispatch:
inputs:
logLevel:
description: "PyInstaller log level"
required: true
default: "INFO"
jobs:
build-executables:
strategy:
fail-fast: false
matrix:
os: [windows-2019, macos-11]
include:
- os: windows-2019
executable_ext: .exe
executable_os: win
- os: macos-11
executable_ext: ""
executable_os: macOS
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # get all history and tags
- uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION_BUILD_EXES }}
- name: Cache the virtualenv
uses: actions/cache@v3
with:
path: ./.venv
key: venv-build-${{ matrix.os }}-${{ hashFiles('**/poetry.lock') }}
- name: Install poetry
run: python -m pip install poetry==1.2.2
- name: Configure poetry
run: poetry config virtualenvs.in-project true
- name: Install dependencies
run: poetry install --without dev
- name: Build with pyinstaller (non Windows, file)
if: "!contains(matrix.os, 'windows')"
working-directory: pyinstaller
run: ./make.sh hpcflow-release-test-build-${{ matrix.executable_os }} INFO 'onefile'
- name: Build with pyinstaller (non Windows, folder)
if: "!contains(matrix.os, 'windows')"
working-directory: pyinstaller
run: ./make.sh hpcflow-release-test-build-${{ matrix.executable_os }}-dir INFO 'onedir'
- name: Build with pyinstaller (Windows, file)
if: contains(matrix.os, 'windows')
working-directory: pyinstaller
run: ./make.ps1 -ExeName "hpcflow-release-test-build-${{ matrix.executable_os }}" -LogLevel INFO -BuildType 'onefile'
- name: Build with pyinstaller (Windows, folder)
if: contains(matrix.os, 'windows')
working-directory: pyinstaller
run: ./make.ps1 -ExeName "hpcflow-release-test-build-${{ matrix.executable_os }}-dir" -LogLevel INFO -BuildType 'onedir'
- name: Compress folder (Windows, folder)
if: contains(matrix.os, 'windows')
working-directory: pyinstaller
run: ./compress.ps1 -ExeName 'hpcflow-release-test-build-${{ matrix.executable_os }}-dir' -BuildType 'onedir'
- name: Compress folder (non-windows, folder)
if: contains(matrix.os, 'windows')
working-directory: pyinstaller
run: ./compress.sh hpcflow-release-test-build-${{ matrix.executable_os }}-dir onedir
- name: Upload executable artifact (file)
uses: actions/upload-artifact@v3
with:
name: hpcflow-release-test-build-${{ matrix.executable_os }}${{ matrix.executable_ext }}
path: pyinstaller/dist/onefile/hpcflow-release-test-build-${{ matrix.executable_os }}${{ matrix.executable_ext }}
- name: Upload executable artifact (folder)
uses: actions/upload-artifact@v3
with:
name: hpcflow-release-test-build-${{ matrix.executable_os }}-dir
path: pyinstaller/dist/onedir/hpcflow-release-test-build-${{ matrix.executable_os }}-dir
- name: Upload compressed artifact (folder)
if: contains(matrix.os, 'windows')
uses: actions/upload-artifact@v3
with:
name: test_compress.zip
path: pyinstaller/dist/onedir/test_compress.zip
- name: Upload compressed artifact II (folder)
if: contains(matrix.os, 'windows')
uses: actions/upload-artifact@v3
with:
name: hpcflow-release-test-build-${{ matrix.executable_os }}-dir.zip
path: pyinstaller/dist/onedir/hpcflow-release-test-build-${{ matrix.executable_os }}-dir.zip
build-executables-linux:
runs-on: ubuntu-latest
container:
image: aplowman/centos7-poetry
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set ownership
run: |
# see: https://github.com/actions/runner/issues/2033#issuecomment-1204205989
# this is to fix GIT not liking owner of the checkout dir
chown -R $(id -u):$(id -g) $PWD
- name: Configure poetry
run: poetry config virtualenvs.in-project true
- name: Cache the virtualenv
uses: actions/cache@v3
with:
path: ./.venv
key: venv-build-CentOS-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
run: poetry install --without dev
- name: Build with pyinstaller for CentOS (file)
working-directory: pyinstaller
run: ./make.sh hpcflow-release-test-build-linux INFO onefile
- name: Build with pyinstaller for CentOS (folder)
working-directory: pyinstaller
run: ./make.sh hpcflow-release-test-build-linux-dir INFO onedir
- name: Upload executable artifact (file)
uses: actions/upload-artifact@v3
with:
name: hpcflow-release-test-build-linux
path: pyinstaller/dist/onefile/hpcflow-release-test-build-linux
- name: Upload executable artifact (folder)
uses: actions/upload-artifact@v3
with:
name: hpcflow-release-test-build-linux-dir
path: pyinstaller/dist/onedir/hpcflow-release-test-build-linux-dir
release-github:
needs: [build-executables, build-executables-linux]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.base.ref }} # otherwise we get the ref when the workflow started (missing above commit)
- run: mkdir release-artifacts
- uses: actions/download-artifact@v3
id: download_executables_I
with:
name: hpcflow-release-test-build-macOS-dir.zip
- uses: actions/download-artifact@v3
id: download_executables_II
with:
name: hpcflow-release-test-build-win-dir.zip
- name: Display structure of downloaded files
run: ls -R
- name: Release
id: release
uses: softprops/action-gh-release@v1
with:
tag_name: test-tag
files: |
test_compress.zip
hpcflow-release-test-build-win-dir.zip
hpcflow-release-test-build-macOS-dir.zip
prerelease: true