Skip to content

Ship 1.5.12 Spanish typing and topic labels #35

Ship 1.5.12 Spanish typing and topic labels

Ship 1.5.12 Spanish typing and topic labels #35

Workflow file for this run

name: Release
on:
push:
tags:
- "v*"
permissions:
contents: write
concurrency:
group: release-${{ github.ref }}
cancel-in-progress: false
jobs:
build-and-release:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.9"
cache: "pip"
- name: Read app version
id: version
shell: pwsh
run: |
$version = python -c "from modules.version import __version__; print(__version__)"
if (-not $version) {
throw "Could not read version from modules/version.py"
}
"app_version=$version" | Out-File -FilePath $env:GITHUB_OUTPUT -Append -Encoding utf8
"release_tag=v$version" | Out-File -FilePath $env:GITHUB_OUTPUT -Append -Encoding utf8
- name: Validate pushed tag matches app version
shell: pwsh
run: |
if ("${{ github.ref_name }}" -ne "${{ steps.version.outputs.release_tag }}") {
throw "Tag ${{ github.ref_name }} does not match app version ${{ steps.version.outputs.app_version }}"
}
- name: Install Python dependencies
shell: pwsh
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt pyinstaller pytest
- name: Install Inno Setup
shell: pwsh
run: choco install innosetup --no-progress -y
- name: Lint
shell: pwsh
run: |
python -m pip install ruff
ruff check .
- name: Run tests
shell: pwsh
run: python -m pytest -q
- name: Build executable
shell: cmd
run: tools\build\build_exe.bat --nopause
- name: Smoke test EXE
shell: pwsh
run: |
$p = Start-Process -FilePath "dist\KeyQuest\KeyQuest.exe" -ArgumentList "--version" -Wait -PassThru -NoNewWindow
if ($p.ExitCode -ne 0) { throw "EXE smoke test failed with exit code $($p.ExitCode)" }
- name: Build portable zip
shell: cmd
run: tools\build\build_portable_zip.bat --nopause
- name: Build installer
shell: cmd
run: tools\build\build_installer.bat --nopause
- name: Verify release outputs
shell: pwsh
run: |
if (-not (Test-Path "dist\KeyQuest-win64.zip")) {
throw "dist\\KeyQuest-win64.zip was not created"
}
if (-not (Test-Path "dist\installer\KeyQuestSetup.exe")) {
throw "dist\\installer\\KeyQuestSetup.exe was not created"
}
- name: Publish GitHub release
shell: pwsh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
$pagesUrl = "https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/"
$releaseIntro = "User guide: $pagesUrl`nChangelog: ${pagesUrl}changelog.html`n"
gh release create "${{ steps.version.outputs.release_tag }}" `
"dist\KeyQuest-win64.zip#KeyQuest-win64.zip" `
"dist\installer\KeyQuestSetup.exe#KeyQuestSetup.exe" `
--title "KeyQuest ${{ steps.version.outputs.app_version }}" `
--notes "$releaseIntro" `
--generate-notes `
--latest