Skip to content

Commit d341872

Browse files
authored
Update pyinstaller.yml
Added routine for a release
1 parent 4e5a300 commit d341872

File tree

1 file changed

+23
-4
lines changed

1 file changed

+23
-4
lines changed

.github/workflows/pyinstaller.yml

+23-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
#on:
2-
# release:
3-
# types: [published]
4-
on: workflow_dispatch
1+
on:
2+
release:
3+
types: [published]
4+
workflow_dispatch:
55

66
jobs:
77
build:
@@ -11,20 +11,39 @@ jobs:
1111
runs-on: ${{ matrix.os }}
1212
steps:
1313
- uses: actions/checkout@v4
14+
1415
- name: Set up Python
1516
uses: actions/setup-python@v4
1617
with:
1718
python-version: '3.10'
19+
1820
- name: install dependencies and Pyinstaller
1921
run: |
2022
python -m pip install --upgrade pip
2123
pip install -r requirements.txt
2224
pip install pyinstaller
25+
2326
- name: build the executable file
2427
run: |
2528
pyinstaller --noconsole --onefile ./pyJSON.py
29+
2630
- name: create artifacts
2731
uses: actions/upload-artifact@v4
2832
with:
2933
name: pyJSON-${{ matrix.os }}
3034
path: ./dist/*
35+
36+
- name: pack data for release
37+
if: github.event_name == "release"
38+
run: |
39+
tag=$(git describe --tags --abbrev=0)
40+
release_name="pyJSON-$tag-${{ matrix.os }}"
41+
7z a -tzip "${release_name}.zip" "./dist/*"
42+
43+
- name: add to release
44+
if: github.event_name == "release"
45+
uses: softprops/action-gh-release@v2
46+
with:
47+
files: pyJSON-*.zip
48+
env:
49+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)