Package Release #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Package Release | |
on: | |
release: | |
types: | |
- published | |
workflow_dispatch: | |
inputs: | |
release: | |
description: Upload to last release? (Used to test the workflow.) | |
type: boolean | |
default: false | |
required: true | |
jobs: | |
build-release: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
- name: Install uv | |
uses: astral-sh/setup-uv@v3 | |
- name: Fetch Licenses | |
run: > | |
uv run --group license-fetching pip-licenses | |
--with-system | |
--from=all | |
--format=plain-vertical | |
--with-urls | |
--with-authors | |
--with-license-file | |
--output-file THIRD-PARTY-LICENSES.txt | |
- name: Fetch Python Interpreter License | |
shell: pwsh | |
run: | | |
$content = "----------------------------------- | |
Python License | |
" | |
$content >> .\THIRD-PARTY-LICENSES.txt | |
Get-Content (Join-Path (Split-Path (get-command python).Source) "LICENSE.txt") >> .\THIRD-PARTY-LICENSES.txt | |
- name: PyInstaller | |
run: > | |
uv run --group pyinstaller pyinstaller -D -y -n gamepadla | |
--recursive-copy-metadata gamepadla_plus | |
--collect-all gamepadla_plus | |
--add-data "LICENSE.txt;." | |
--add-data "THIRD-PARTY-LICENSES.txt;." | |
--hide-console hide-late | |
--noupx | |
.\gamepadla_plus\__main__.py | |
- name: Inno Setup Build | |
shell: pwsh | |
run: | | |
$ver = uv run .\helper\version.py | |
iscc /DMyAppVersion=$ver .\inno-setup.iss | |
- name: Copy Docs | |
run: cp .\LICENSE.txt .\dist\gamepadla\ && cp .\README.md .\dist\gamepadla\ && cp .\THIRD-PARTY-LICENSES.txt .\dist\gamepadla\ | |
- name: 7z | |
run: 7z a gamepadla-plus-windows-x64-portable.7z .\dist\gamepadla\ | |
- name: Upload To Release | |
if: ${{ inputs.release == null || inputs.release }} | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: | | |
gamepadla-plus-windows-x64-portable.7z | |
gamepadla-plus-windows-x64-installer.exe | |