-
Notifications
You must be signed in to change notification settings - Fork 11
50 lines (41 loc) · 1.48 KB
/
main.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
name: Build Windows Executable
on:
release:
types: [published]
jobs:
build:
runs-on: windows-latest
env:
VERSION: ${{ github.ref_name }} # Extract the version from the GitHub tag
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.x"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pyinstaller
- name: Build executable
run: |
pyinstaller --name=mmrelay_${{ env.VERSION }} --onefile --console main.py
# This will create mmrelay_<version>.exe in the dist folder
- name: Build installer
uses: nadeemjazmawe/[email protected]
with:
filepath: "/DAppVersion=${{ env.VERSION }} ./mmrelay.iss"
# Pass the version to Inno Setup
- name: Rename Installer with Version
run: |
Rename-Item "MMRelay_setup.exe" "MMRelay_setup_${{ env.VERSION }}.exe"
# Rename the installer to include the version number
- name: Upload setup.exe to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: MMRelay_setup_${{ env.VERSION }}.exe # Upload the versioned installer
asset_name: MMRelay_setup_${{ env.VERSION }}.exe
tag: ${{ github.ref }}
overwrite: true