-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-python-executable.yaml
57 lines (48 loc) · 1.19 KB
/
build-python-executable.yaml
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
name: Build and Release Python Scripts
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
strategy:
matrix:
os: [windows-latest, macos-latest, ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.x"
- run: |
pip install -r requirements.txt
pip install pyinstaller
- name: Build executables
run: |
for file in *.py
do
pyinstaller --onefile "$file"
done
shell: bash
- uses: actions/upload-artifact@v3
with:
name: ${{ matrix.os }}-executables
path: dist/*
release:
needs: build
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- uses: actions/download-artifact@v3
- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: |
**/*
tag_name: v${{ github.run_number }}
draft: false
prerelease: false
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}