Skip to content

Commit

Permalink
*Update: github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
eVen-gits committed Mar 4, 2025
1 parent e4beebe commit e04f72b
Showing 1 changed file with 53 additions and 12 deletions.
65 changes: 53 additions & 12 deletions .github/workflows/generate_win_exe.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Generate Windows executable
name: Generate Windows Executable and Package Repository

on:
workflow_dispatch:
push:
Expand All @@ -9,23 +10,63 @@ jobs:
gen-exe:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Install requirements
python-version: '3.12'

- name: Install dependencies
run: pip install -r requirements.txt
- name: Install additional dependencies
run: pip install PyInstaller

- name: Install PyInstaller
run: pip install pyinstaller

- name: Generate executable
run: pyinstaller --onefile --name "EDH_matchmaker" --icon=media/icon.ico --add-data "ui\\;ui" run_ui.py
shell: pwsh
run: |
pyinstaller --onefile --name "EDH_matchmaker" --icon=media/icon.ico run_ui.py
pyinstaller --onefile --name "EDH_matchmaker" --icon=media/icon.ico -p . run_ui.py
- name: Sign the executable with Sigstore
uses: sigstore/sigstore-action@v1
with:
path: dist/EDH_matchmaker.exe
key_type: "cosign"

- name: Remove build files and move the executable to root
run: |
rm -r build
rm EDH_matchmaker.spec
mv dist/EDH_matchmaker.exe .
# Upload executable as an artifact
- uses: actions/upload-artifact@v4
- name: Package repository into a zip file
run: |
Compress-Archive -Path * -DestinationPath EDH_matchmaker_${{ github.ref_name }}.zip
- name: Upload ZIP archive as artifact
uses: actions/upload-artifact@v4
with:
name: EDH_matchmaker_package
path: EDH_matchmaker_${{ github.ref_name }}.zip

create-release:
needs: gen-exe
runs-on: ubuntu-latest
steps:
- name: Download ZIP archive
uses: actions/download-artifact@v4
with:
name: EDH_matchmaker_package

- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
name: EDH_matchmaker
path: EDH_matchmaker.exe
tag_name: ${{ github.ref_name }}
name: Release ${{ github.ref_name }}
body: "Automated release of ${{ github.ref_name }} including full repository and executable."
draft: false
prerelease: false
files: EDH_matchmaker_${{ github.ref_name }}.zip

0 comments on commit e04f72b

Please sign in to comment.