-
-
Notifications
You must be signed in to change notification settings - Fork 39
83 lines (68 loc) · 1.89 KB
/
Copy pathbuild-windows.yml
File metadata and controls
83 lines (68 loc) · 1.89 KB
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
73
74
75
76
77
78
79
80
81
82
83
name: Build Windows
on:
workflow_call:
inputs:
version:
required: true
type: string
permissions:
contents: write
jobs:
build:
name: Build
runs-on: windows-2025
defaults:
run:
shell: bash
env:
PYTHON_VERSION: '3.12'
APP_NAME: TwitchLink
OUTPUT_FILENAME: TwitchLinkSetup-${{ inputs.version }}.exe
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
sparse-checkout: |
/*
!/.github/build/macos
!/resources/dependencies/macos
sparse-checkout-cone-mode: false
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pyinstaller
- name: Prepare build files
run: cp -r .github/build/windows/* .
- name: Update build files with version
run: |
sed -i 's/{{APP_VERSION}}/${{ inputs.version }}/g' TwitchLink.spec
sed -i 's/{{APP_VERSION}}/${{ inputs.version }}/g' Script.iss
echo "✅ Updated files with version: ${{ inputs.version }}"
- name: Build executable
run: |
pyinstaller TwitchLink.spec
if [ $? -ne 0 ]; then
echo "❌ Executable build failed"
exit 1
fi
echo "✅ Built executable: ${{ env.APP_NAME }}.exe"
- name: Install Inno Setup
run: |
choco install innosetup -y
- name: Build installer
run: |
iscc "Script.iss"
if [ $? -ne 0 ]; then
echo "❌ Installer build failed"
exit 1
fi
echo "✅ Built: ${{ env.OUTPUT_FILENAME }}"
- name: Upload to release
uses: softprops/action-gh-release@v2
with:
files: "Output/${{ env.OUTPUT_FILENAME }}"