Skip to content

Commit 14cf9e5

Browse files
committed
Add release workflow
1 parent 0e44172 commit 14cf9e5

2 files changed

Lines changed: 128 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
name: Release
2+
on:
3+
push:
4+
branches:
5+
- main
6+
7+
workflow_dispatch:
8+
9+
jobs:
10+
create-release:
11+
12+
runs-on: ubuntu-latest
13+
name: Create Release
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
18+
- run: git fetch --tags origin
19+
20+
- name: Get previous tag
21+
id: previoustag
22+
uses: 'WyriHaximus/github-action-get-previous-tag@v1'
23+
env:
24+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25+
26+
- name: Next Monotonic Release version
27+
id: next
28+
uses: WyriHaximus/github-action-next-release-version@08a7476c98e8095fad1cce0e2344c7892e17d111
29+
with:
30+
version: ${{ steps.previoustag.outputs.tag }}
31+
32+
- name: Create Release
33+
uses: softprops/action-gh-release@v1
34+
if: ${{ github.event.inputs.version == '' }}
35+
with:
36+
tag_name: ${{ steps.next.outputs.version }}
37+
38+
build:
39+
strategy:
40+
matrix:
41+
os: [ubuntu-latest, windows-latest]
42+
43+
runs-on: ${{ matrix.os }}
44+
45+
needs: create-release
46+
if: ${{ always() && !cancelled() && needs.create-release.result == 'success' }}
47+
steps:
48+
- name: Checkout
49+
uses: actions/checkout@v4
50+
51+
- name: Setup Python
52+
uses: actions/setup-python@v5
53+
with:
54+
python-version: '3.13'
55+
cache: 'pip'
56+
cache-dependency-path: 'requirements.txt'
57+
58+
- name: Install dependencies
59+
run: |
60+
python -m pip install -r requirements.txt
61+
62+
python -m pip install -r requirements_optional.txt
63+
64+
python -m pip install PyInstaller
65+
66+
- run: |
67+
pwd
68+
69+
python -m PyInstaller --distpath dist/ -y ccautovcd.spec
70+
71+
shell: bash
72+
73+
- name: Pack files
74+
uses: TheDoctor0/zip-release@0.7.6
75+
with:
76+
filename: Release-${{ runner.os }}.zip
77+
directory: ./dist/
78+
79+
- run: git fetch --tags origin
80+
81+
- name: Get previous tag
82+
id: previoustag
83+
uses: 'WyriHaximus/github-action-get-previous-tag@v1'
84+
env:
85+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
86+
87+
- name: Upload to release
88+
uses: softprops/action-gh-release@v1
89+
if: ${{ github.event.inputs.version == '' }}
90+
with:
91+
tag_name: ${{ steps.previoustag.outputs.tag }}
92+
files: dist/Release-${{ runner.os }}.zip
93+
fail_on_unmatched_files: true

ccautovcd.spec

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
a = Analysis(
2+
['src/main.py'],
3+
pathex=[],
4+
binaries=[],
5+
datas=[],
6+
hiddenimports=[],
7+
hookspath=[],
8+
hooksconfig={},
9+
runtime_hooks=[],
10+
excludes=[],
11+
noarchive=False,
12+
optimize=0,
13+
)
14+
pyz = PYZ(a.pure)
15+
16+
exe = EXE(
17+
pyz,
18+
a.scripts,
19+
a.binaries,
20+
a.datas,
21+
[],
22+
name='CCAutoVCD',
23+
debug=False,
24+
bootloader_ignore_signals=False,
25+
strip=False,
26+
upx=True,
27+
upx_exclude=[],
28+
runtime_tmpdir=None,
29+
console=True,
30+
disable_windowed_traceback=False,
31+
argv_emulation=False,
32+
target_arch=None,
33+
codesign_identity=None,
34+
entitlements_file=None,
35+
)

0 commit comments

Comments
 (0)