Skip to content

Update release.yml

Update release.yml #1

Workflow file for this run

name: Build and Release Standalone GUI
on:
push:
tags:
- "v*"
- "V*"
permissions:
contents: write
jobs:
generate-release-notes:
runs-on: ubuntu-latest
outputs:
changelog: ${{ steps.notes.outputs.changelog }}
steps:
- uses: actions/checkout@v4
- id: notes
run: |
echo "changelog=$(git log -20 --pretty=format:'* %s')" >> $GITHUB_OUTPUT
build-windows:
needs: generate-release-notes
runs-on: windows-latest
defaults:
run:
working-directory: Tool
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.9"
- name: Install requirements
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Cleanup before PyInstaller
shell: pwsh
run: |
Remove-Item -Recurse -Force build,dist -ErrorAction SilentlyContinue
Remove-Item -Force *.spec -ErrorAction SilentlyContinue
try { pip cache purge } catch { Write-Host "pip cache purge failed (ignored)" }
- name: Build exe
run: |
pyinstaller --noconfirm --clean --windowed --onefile `
--name "SoccerNetProAnalyzer" `
--add-data "style;style" `
--add-data "ui;ui" `
--add-data "ui2;ui2" `
"main.py"
- name: Rename binary
shell: pwsh
run: |
Move-Item -Force dist\SoccerNetProAnalyzer.exe dist\SoccerNetProAnalyzer-win.exe
- name: Zip Windows binary
shell: pwsh
run: |
Compress-Archive -Path dist\SoccerNetProAnalyzer-win.exe -DestinationPath dist\SoccerNetProAnalyzer-win.zip -Force
- name: Upload Release Asset (Windows)
uses: softprops/action-gh-release@v2
with:
files: Tool/dist/SoccerNetProAnalyzer-win.zip
tag_name: ${{ github.ref_name }}
body: ${{ needs.generate-release-notes.outputs.changelog }}
build-macos:
needs: generate-release-notes
runs-on: macos-latest
defaults:
run:
working-directory: Tool
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.9"
- name: Install requirements
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Cleanup before PyInstaller
run: |
rm -rf build dist *.spec
pip cache purge || true
- name: Build binary
run: |
pyinstaller --noconfirm --clean --windowed --onefile \
--name "SoccerNetProAnalyzer" \
--add-data "style:style" \
--add-data "ui:ui" \
--add-data "ui2:ui2" \
"main.py"
- name: Rename binary
run: |
mv -f dist/SoccerNetProAnalyzer dist/SoccerNetProAnalyzer-mac
- name: Zip macOS binary
run: |
cd dist
zip -r SoccerNetProAnalyzer-mac.zip SoccerNetProAnalyzer-mac
cd ..
- name: Upload Release Asset (macOS)
uses: softprops/action-gh-release@v2
with:
files: Tool/dist/SoccerNetProAnalyzer-mac.zip
tag_name: ${{ github.ref_name }}
body: ${{ needs.generate-release-notes.outputs.changelog }}
build-linux:
needs: generate-release-notes
runs-on: ubuntu-latest
defaults:
run:
working-directory: Tool
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.9"
- name: Install system deps (Qt/OpenCV runtime)
run: |
sudo apt-get update
sudo apt-get install -y libgl1 libglib2.0-0
- name: Install requirements
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Cleanup before PyInstaller
run: |
rm -rf build dist *.spec
pip cache purge || true
- name: Build binary
run: |
pyinstaller --noconfirm --clean --windowed --onefile \
--name "SoccerNetProAnalyzer" \
--add-data "style:style" \
--add-data "ui:ui" \
--add-data "ui2:ui2" \
"main.py"
- name: Rename binary
run: |
mv -f dist/SoccerNetProAnalyzer dist/SoccerNetProAnalyzer-linux
- name: Zip Linux binary
run: |
cd dist
zip -r SoccerNetProAnalyzer-linux.zip SoccerNetProAnalyzer-linux
cd ..
- name: Upload Release Asset (Linux)
uses: softprops/action-gh-release@v2
with:
files: Tool/dist/SoccerNetProAnalyzer-linux.zip
tag_name: ${{ github.ref_name }}
body: ${{ needs.generate-release-notes.outputs.changelog }}