Exclude Python 3.13.4 since it breaks package building #210
Workflow file for this run
This file contains hidden or 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 and release | |
on: [workflow_call] | |
permissions: {} | |
jobs: | |
package-windows: | |
runs-on: windows-2022 | |
strategy: | |
matrix: | |
setup: | |
- type: installer | |
- type: portable | |
build-portable: 1 | |
- type: store-app | |
disable-autoupdate: 1 | |
fail-fast: false | |
env: | |
CODESIGN: ${{ !!secrets.AZURE_CERT_PROFILE_NAME }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Fetch entire history, needed for setting the build number | |
- run: git fetch --depth=1 origin +refs/tags/release-*:refs/tags/release-* | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '>=3.13.5 <3.14' | |
cache: 'pip' | |
cache-dependency-path: | | |
requirements-build.txt | |
requirements-win.txt | |
- name: Setup Windows build environment | |
run: | | |
& .\scripts\package\win-setup.ps1 ` | |
-DiscidVersion $Env:DISCID_VERSION -DiscidSha256Sum $Env:DISCID_SHA256SUM ` | |
-FpcalcVersion $Env:FPCALC_VERSION -FpcalcSha256Sum $Env:FPCALC_SHA256SUM | |
Add-Content $env:GITHUB_PATH "C:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0\x64" | |
New-Item -Name .\artifacts -ItemType Directory | |
env: | |
DISCID_VERSION: 0.6.5 | |
DISCID_SHA256SUM: a1198731d417a04b3d8499bcc10b6a8ddcab06476c855ebff0fb4134888b1be5 | |
FPCALC_VERSION: 1.5.1 | |
FPCALC_SHA256SUM: 36b478e16aa69f757f376645db0d436073a42c0097b6bb2677109e7835b59bbc | |
- name: Install gettext | |
run: | | |
& .\scripts\package\win-setup-gettext.ps1 ` | |
-GettextVersion $Env:GETTEXT_VERSION -GettextSha256Sum $Env:GETTEXT_SHA256SUM | |
Add-Content $env:GITHUB_PATH (Join-Path -Path (Resolve-Path .) -ChildPath gettext\bin) | |
env: | |
GETTEXT_VERSION: 0.22.4 | |
GETTEXT_SHA256SUM: 220068ac0b9e7aedda03534a3088e584640ac1e639800b3a0baa9410aa6d012a | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements-build.txt | |
pip install -r requirements-win.txt | |
- name: Patch build version | |
if: startsWith(github.ref, 'refs/tags/') != true | |
run: | | |
$ReleaseTag = $(git describe --match "release-*" --abbrev=0 --always HEAD) | |
$BuildNumber = $(git rev-list --count "$ReleaseTag..HEAD") | |
python setup.py patch_version --platform=$Env:BUILD_NUMBER.$(git rev-parse --short HEAD) | |
- name: Run tests | |
timeout-minutes: 30 | |
run: pytest --verbose | |
- name: Prepare clean build environment | |
run: | | |
Remove-Item -Path build,dist/picard,locale -Recurse -ErrorAction Ignore | |
python setup.py clean | |
- name: Build | |
run: | | |
python setup.py build --build-number=$BuildNumber --disable-locales | |
python setup.py build_locales | |
python setup.py build_ext -i | |
pyinstaller --noconfirm --clean picard.spec | |
If ($env:PICARD_BUILD_PORTABLE -ne "1") { | |
dist\picard\_internal\fpcalc -version | |
} | |
env: | |
PICARD_APPX_PUBLISHER: CN=0A9169B7-05A3-4ED9-8876-830F17846709 | |
PICARD_BUILD_PORTABLE: ${{ matrix.setup.build-portable }} | |
PICARD_DISABLE_AUTOUPDATE: ${{ matrix.setup.disable-autoupdate }} | |
- name: Sign picard.exe | |
uses: azure/trusted-signing-action@v0.5.1 | |
if: matrix.setup.type != 'portable' && env.CODESIGN == 'true' | |
with: | |
azure-tenant-id: ${{ secrets.AZURE_TENANT_ID }} | |
azure-client-id: ${{ secrets.AZURE_CLIENT_ID }} | |
azure-client-secret: ${{ secrets.AZURE_CLIENT_SECRET }} | |
endpoint: ${{ secrets.AZURE_ENDPOINT }} | |
trusted-signing-account-name: ${{ secrets.AZURE_CODE_SIGNING_NAME }} | |
certificate-profile-name: ${{ secrets.AZURE_CERT_PROFILE_NAME }} | |
files-folder: dist\picard | |
files-folder-filter: exe | |
files-folder-recurse: true | |
timestamp-rfc3161: http://timestamp.acs.microsoft.com | |
timestamp-digest: SHA256 | |
- name: Build Windows installer | |
if: matrix.setup.type == 'installer' | |
run: | | |
makensis.exe /INPUTCHARSET UTF8 installer\picard-setup.nsi | |
Move-Item .\installer\*.exe .\artifacts | |
- name: Build Windows portable app | |
if: matrix.setup.type == 'portable' | |
run: | | |
Move-Item .\dist\*.exe .\artifacts | |
- name: Build Windows 10 store app package | |
if: matrix.setup.type == 'store-app' | |
uses: GuillaumeFalourd/setup-windows10-sdk-action@v2.4 | |
run: | | |
& .\scripts\package\win-package-appx.ps1 dist\picard | |
Move-Item .\dist\*.msix .\artifacts | |
- name: Sign final executable | |
uses: azure/trusted-signing-action@v0.5.1 | |
if: matrix.setup.type != 'store-app' && env.CODESIGN == 'true' | |
with: | |
azure-tenant-id: ${{ secrets.AZURE_TENANT_ID }} | |
azure-client-id: ${{ secrets.AZURE_CLIENT_ID }} | |
azure-client-secret: ${{ secrets.AZURE_CLIENT_SECRET }} | |
endpoint: ${{ secrets.AZURE_ENDPOINT }} | |
trusted-signing-account-name: ${{ secrets.AZURE_CODE_SIGNING_NAME }} | |
certificate-profile-name: ${{ secrets.AZURE_CERT_PROFILE_NAME }} | |
files-folder: artifacts | |
files-folder-filter: exe | |
timestamp-rfc3161: http://timestamp.acs.microsoft.com | |
timestamp-digest: SHA256 | |
- name: Archive production artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: windows-${{ matrix.setup.type }} | |
path: artifacts/ |