-
Notifications
You must be signed in to change notification settings - Fork 2
72 lines (61 loc) · 1.92 KB
/
build-pid-sim-app.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
name: Build and Release EXE
on:
push:
branches: [ "main" ]
permissions:
contents: write
releases: write
jobs:
build-and-release:
runs-on: windows-latest
steps:
# 1. Checkout the repository
- uses: actions/checkout@v4
# 2. Set up Python
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.12"
# 3. Install dependencies using Poetry
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
poetry install
# 4. Install PyInstaller
- name: Install PyInstaller
run: |
pip install pyinstaller
# 5. Build the executable with PyInstaller
- name: Build executable with PyInstaller
run: |
pyinstaller --onefile --name pid-sim src/gui/main.py
# 6. Verify the build (optional)
- name: Verify executable
run: |
if (!(Test-Path "dist\pid-sim.exe")) {
Write-Error "Executable not found!"
exit 1
}
# 7. Create a GitHub Release
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}
with:
tag_name: "release-${{ github.run_number }}"
release_name: "Release ${{ github.run_number }}"
body: "Автоматически сгенерированный релиз."
draft: false
prerelease: false
# 8. Upload the executable as a release asset
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/pid-sim.exe
asset_name: pid-sim.exe
asset_content_type: application/octet-stream