1
- name : Create a new release
2
- run-name : ${{ github.actor }} creating a new release 🧉
1
+ name : Build binary & Create release
2
+ run-name : ${{ github.actor }} building the pyinstaller binary and creating the release 🧉
3
3
4
- # Set the access for individual scopes, or use permissions: write-all
5
4
permissions :
6
5
pull-requests : write
7
6
contents : write
8
7
packages : write
9
8
10
9
on :
11
10
push :
11
+ branches : ["**"]
12
12
tags :
13
13
- " v*.*.*"
14
14
15
15
jobs :
16
16
tests :
17
17
uses : ./.github/workflows/ci_job.yml
18
+ build-no-linux :
19
+ name : Build packages
20
+ runs-on : ${{ matrix.os }}
21
+ strategy :
22
+ matrix :
23
+ include :
24
+ - os : macos-12
25
+ target : osx-x64
26
+ arch : x86_64
27
+ py_arch : x64
28
+ asset_mime : application/octet-stream
29
+ exe : deploy-freva
30
+ hidden_import : --hidden-import curses --hidden-import cowsay
31
+ extra_pkg : cryptography
32
+ - os : macos-14
33
+ target : osx-arm64
34
+ arch : arm64
35
+ py_arch : arm64
36
+ asset_mime : application/octet-stream
37
+ exe : deploy-freva
38
+ hidden_import : --hidden-import curses --hidden-import cowsay
39
+ extra_pkg : cryptography
40
+ - os : windows-2019
41
+ target : windows-x64
42
+ arch : x86_64
43
+ py_arch : x64
44
+ asset_mime : application/vnd.microsoft.portable-executable
45
+ hidden_import : --hidden-import windows-curses --hidden-import cowsay
46
+ extra_pkg : windows-curses cryptography
47
+ exe : deploy-freva.exe
48
+
49
+ steps :
50
+ - uses : actions/checkout@v4
51
+ - name : Set up Python "3.X" on ${{ matrix.os }}
52
+ uses : actions/setup-python@v4
53
+ with :
54
+ python-version : " 3.X"
55
+ architecture : ${{ matrix.py_arch }}
56
+ - name : Install dependencies
57
+ run : |
58
+ python3 -m pip install --upgrade pip
59
+ python3 -m pip install pyinstaller ansible ${{ matrix.extra_pkg }} .
60
+ - name : Build with cmd pyinstaller for ${{ matrix.target }}
61
+ run : >
62
+ pyinstaller pyinstaller/pyinstaller-deploy-freva.py -c
63
+ --name deploy-freva --onefile --clean -i docs/_static/freva_owl.ico
64
+ --add-data 'assets/share/freva/deployment:freva_deployment/assets'
65
+ --add-data 'src/freva_deployment/versions.json:freva_deployment'
66
+ --target-arch ${{matrix.arch}}
67
+ ${{matrix.hidden_import}}
68
+ --exclude-module pycrypto --exclude-module PyInstaller
69
+ - name : Test built bindary
70
+ run : ./dist/${{matrix.exe}} --help
71
+ - name : Upload cmd Asset
72
+ uses : actions/upload-artifact@v3
73
+ with :
74
+ path : dist/${{matrix.exe}}
75
+ name : deploy-freva-${{ matrix.target }}
76
+ retention-days : 7
77
+
78
+ build-linux :
79
+ name : Build packages
80
+ runs-on : ubuntu-latest
81
+ strategy :
82
+ matrix :
83
+ include :
84
+ - arch : linux/amd64
85
+ target : linux-x64
86
+ - arch : linux/arm64
87
+ target : linux-arm64
88
+ - arch : linux/arm/v7
89
+ target : linux-armvl7
90
+ - arch : linux/arm/v6
91
+ target : linux-armvl6
92
+ - arch : linux/ppc64le
93
+ target : linux-ppc64
94
+ - arch : linux/s390x
95
+ target : linux-s390x
96
+ - arch : linux/i386
97
+ target : linux-i386
98
+
99
+ steps :
100
+
101
+ - name : Checkout repository
102
+ uses : actions/checkout@v4
103
+ with :
104
+ fetch-depth : 0
105
+
106
+ - name : Set up QEMU
107
+ uses : docker/setup-qemu-action@v2
108
+ with :
109
+ platforms : all
110
+
111
+ - name : Set up Docker Buildx
112
+ uses : docker/setup-buildx-action@v2
113
+ with :
114
+ install : true
115
+
116
+ - name : Create Buildx builder
117
+ run : docker buildx create --use --name mybuilder --driver docker-container
118
+
119
+ - name : Inspect Buildx builder
120
+ run : docker buildx inspect --bootstrap
121
+
122
+ - name : Build Docker image
123
+ uses : docker/build-push-action@v4
124
+ with :
125
+ file : Dockerfile
126
+ platforms : ${{ matrix.arch }}
127
+ push : false
128
+ load : true
129
+ tags : pyinstaller:${{ matrix.target }}
130
+
131
+ - name : Run PyInstaller in Docker
132
+ run : >
133
+ docker run --rm -v $PWD:/src -w /src --platform ${{ matrix.arch }}
134
+ pyinstaller:${{ matrix.target }} pyinstaller
135
+ pyinstaller/pyinstaller-deploy-freva.py -c
136
+ --name deploy-freva --onefile --clean -i docs/_static/freva_owl.ico
137
+ --add-data 'assets/share/freva/deployment:freva_deployment/assets'
138
+ --add-data 'src/freva_deployment/versions.json:freva_deployment'
139
+ --hidden-import cowsay --hidden-import cryptography
140
+ --exclude-module pycrypto --exclude-module PyInstaller
141
+
142
+ - name : Test built bindary
143
+ run : >
144
+ docker run --rm -v $PWD:/src -w /src --platform ${{ matrix.arch }}
145
+ pyinstaller:${{ matrix.target }} /src/dist/deploy-freva --help
146
+
147
+ - name : Upload cmd Asset
148
+ if : startsWith(github.ref, 'refs/tags/')
149
+ uses : actions/upload-artifact@v4
150
+ with :
151
+ path : dist/
152
+ name : deploy-freva-${{ matrix.target }}
153
+
18
154
pypi :
19
155
name : Create Pip package
20
156
permissions :
21
157
id-token : write
22
- needs : [tests]
158
+ needs : [tests, build-linux, build-no-linux ]
23
159
runs-on : ubuntu-latest
160
+ if : startsWith(github.ref, 'refs/tags/')
24
161
steps :
25
162
-
26
163
name : Checkout
@@ -45,10 +182,12 @@ jobs:
45
182
password : ${{ secrets.PYPI_API_TOKEN }}
46
183
skip-existing : true
47
184
verbose : true
48
- createrelease :
185
+
186
+ release :
49
187
name : Create Release
50
- runs-on : [ubuntu-latest]
51
- needs : pypi
188
+ needs : [build-no-linux, build-linux]
189
+ runs-on : ubuntu-latest
190
+ if : startsWith(github.ref, 'refs/tags/')
52
191
steps :
53
192
- name : Create Release
54
193
id : create_release
@@ -67,53 +206,50 @@ jobs:
67
206
with :
68
207
name : release_url
69
208
path : release_url.txt
70
- build :
71
- name : Build packages
72
- needs : [pypi, createrelease]
73
- runs-on : ${{ matrix.os }}
209
+
210
+ upload-builds :
211
+ name : Add binaries to Release
212
+ needs : release
213
+ runs-on : ubuntu-latest
74
214
strategy :
75
215
matrix :
76
216
include :
77
- - os : macos-latest
78
- TARGET : macos
79
- CMD_BUILD : >
80
- pyinstaller pyinstaller/pyinstaller-script.py -c --name deploy-freva --onefile
81
- OUT_FILE_NAME : deploy-freva
82
- ASSET_MIME : application/octet-stream
83
- - os : windows-latest
84
- TARGET : windows
85
- CMD_BUILD : pyinstaller pyinstaller/pyinstaller-script.py -c --name deploy-freva --onefile
86
- OUT_FILE_NAME : deploy-freva.exe
87
- ASSET_MIME : application/vnd.microsoft.portable-executable
217
+ - target : linux-x64
218
+ asset_mime : application/octet-stream
219
+ - target : linux-arm64
220
+ asset_mime : application/octet-stream
221
+ - target : linux-armvl7
222
+ asset_mime : application/octet-stream
223
+ - target : linux-armvl6
224
+ asset_mime : application/octet-stream
225
+ - target : linux-ppc64
226
+ asset_mime : application/octet-stream
227
+ - target : linux-s390x
228
+ asset_mime : application/octet-stream
229
+ - target : linux-i386
230
+ asset_mime : application/octet-stream
231
+ - target : osx-x64
232
+ asset_mime : application/octet-stream
233
+ - target : osx-arm64
234
+ asset_mime : application/octet-stream
235
+ - target : windows-x64
236
+ asset_mime : application/vnd.microsoft.portable-executable
237
+ if : startsWith(github.ref, 'refs/tags/')
88
238
steps :
89
- - uses : actions/checkout@v4
90
- - name : Set up Python 3.X
91
- uses : actions/setup-python@v4
92
- with :
93
- python-version : " 3.X"
94
- - name : Install dependencies
95
- run : |
96
- python3 -m pip install --upgrade pip
97
- python3 -m pip install pyinstaller ansible .
98
- - name : Build with pyinstaller for ${{matrix.TARGET}}
99
- run : ${{matrix.CMD_BUILD}}
100
- - name : Load Release URL File from release job
101
- uses : actions/download-artifact@v1
239
+ - name : Checkout repository
240
+ uses : actions/checkout@v4
241
+
242
+ - name : Download artifacts
243
+ uses : actions/download-artifact@v3
102
244
with :
103
- name : release_url
104
- - name : Get Release File Name & Upload URL
105
- id : get_release_info
106
- shell : bash
107
- run : |
108
- value=`cat release_url/release_url.txt`
109
- echo ::set-output name=upload_url::$value
110
- - name : Upload Release Asset
111
- id : upload-release-asset
245
+ path : ./artifacts
246
+
247
+ - name : Upload Release Assets
112
248
uses : actions/upload-release-asset@v1
113
249
env :
114
250
GITHUB_TOKEN : ${{ secrets.ASSET_TOKEN }}
115
251
with :
116
- upload_url : ${{ steps.get_release_info .outputs.upload_url }}
117
- asset_path : ./dist/ ${{ matrix.OUT_FILE_NAME }}
118
- asset_name : ${{ matrix.OUT_FILE_NAME }}
119
- asset_content_type : ${{ matrix.ASSET_MIME }}
252
+ upload_url : ${{ steps.create_release .outputs.upload_url }}
253
+ asset_path : ./artifacts/deploy-freva- ${{matrix.target }}
254
+ asset_name : deploy-freva- ${{ matrix.target }}
255
+ asset_content_type : ${{matrix.asset_mime }}
0 commit comments