Skip to content

Build

Build #1023

Workflow file for this run

name: Build
on:
push:
branches: ["*"]
tags-ignore: [continuous]
paths:
- '.github/workflows/build.yml'
- 'appimage/*'
- 'appimagecraft.yml'
- 'build-appimage.sh'
- 'patch-version.sh'
pull_request:
workflow_dispatch:
schedule:
- cron: '0 0 * * *' # every day at midnight
env:
APPIMAGE_EXTRACT_AND_RUN: 1
jobs:
appimage:
name: Build AppImage
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v6
- name: Install gettext
run: |
sudo apt-get update
sudo apt-get install gettext
- name: Build AppImage
run: |
./build-appimage.sh
- name: Archive artifacts
uses: actions/upload-artifact@v6
with:
name: AppImage
path: MusicBrainz-Picard*.AppImage*
windows-portable:
name: Build Windows portable
runs-on: windows-latest
env:
CODESIGN: ${{ !!secrets.AZURE_CERT_PROFILE_NAME }}
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: 3.8
- name: Clone Picard
run: |
git clone --depth 500 --branch 2.x "https://github.com/metabrainz/picard.git" source
cd source
git fetch --depth=1 origin "+refs/tags/release-*:refs/tags/release-*"
- name: Install dependencies
run: |
cd source
python -m pip install --upgrade pip
pip install -r requirements-build.txt
pip install -r requirements-win.txt
pip install zstandard
- name: Setup Windows build environment
run: |
cd source
& .\scripts\package\win-setup.ps1 `
-DiscidVersion $Env:DISCID_VERSION -DiscidSha256Sum $Env:DISCID_SHA256SUM `
-FpcalcVersion $Env:FPCALC_VERSION -FpcalcSha256Sum $Env:FPCALC_SHA256SUM
Write-Output "C:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0\x64" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8
env:
DISCID_VERSION: 0.6.5
DISCID_SHA256SUM: a1198731d417a04b3d8499bcc10b6a8ddcab06476c855ebff0fb4134888b1be5
FPCALC_VERSION: 1.6.0
FPCALC_SHA256SUM: 30179d3d0dc4cc92f1a0995c1a2e523fb4867724c2ee6a6ceae474f8e4d6937a
- name: Install gettext
run: |
& .\source\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: Patch build version
shell: bash
run: |
./patch-version.sh
- name: Build Windows portable app
run: |
cd source
$ReleaseTag = $(git describe --match "release-*" --abbrev=0 --always HEAD)
$BuildNumber = $(git rev-list --count "$ReleaseTag..HEAD")
python setup.py build --build-number=$BuildNumber
python setup.py build_ext
pyinstaller --noconfirm --clean picard.spec
mv dist\MusicBrainz-Picard-*.exe dist\MusicBrainz-Picard-daily.exe
env:
PICARD_BUILD_PORTABLE: 1
- name: Code signing
uses: azure/trusted-signing-action@v0.5.11
if: 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: ${{ github.workspace }}\source\dist\MusicBrainz-Picard-daily.exe
timestamp-rfc3161: http://timestamp.acs.microsoft.com
timestamp-digest: SHA256
- name: Archive artifacts
uses: actions/upload-artifact@v6
with:
name: Windows
path: source/dist/*.exe
upload:
name: Create release and upload artifacts
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
needs:
- appimage
- windows-portable
steps:
- name: Download artifacts
uses: actions/download-artifact@v7
with:
path: artifacts/
- name: Inspect directory after downloading artifacts
run: ls -alFR
- name: Create release and upload artifacts
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
GITHUB_CONTINUOUS_RELEASE_NAME: MusicBrainz Picard daily builds
run: |
wget -q https://github.com/TheAssassin/pyuploadtool/releases/download/continuous/pyuploadtool-x86_64.AppImage
chmod +x pyuploadtool-x86_64.AppImage
./pyuploadtool-x86_64.AppImage artifacts/**/MusicBrainz-Picard*.{AppImage*,exe}