Migrate to azure/artifact-signing-action@v1 #1045
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: 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: Clone Picard | |
| run: | | |
| git clone --depth 500 --branch master "https://github.com/metabrainz/picard.git" source | |
| cd source | |
| git fetch --depth=1 origin "+refs/tags/release-*:refs/tags/release-*" | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| - 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 | |
| permissions: | |
| id-token: write | |
| env: | |
| CODESIGN: ${{ !!secrets.AZURE_CERT_PROFILE_NAME }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Clone Picard | |
| run: | | |
| git clone --depth 500 --branch master "https://github.com/metabrainz/picard.git" source | |
| cd source | |
| git fetch --depth=1 origin "+refs/tags/release-*:refs/tags/release-*" | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.14' | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| - 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: Install dependencies | |
| run: | | |
| cd source | |
| uv sync --group build --group dev --extra plugins | |
| - name: Patch build version | |
| shell: bash | |
| run: | | |
| cd source | |
| uv run bash ../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") | |
| uv run python setup.py build --build-number=$BuildNumber --disable-locales | |
| uv run python setup.py build_locales | |
| uv run python setup.py build_ext -i | |
| uv run pyinstaller --noconfirm --clean picard.spec | |
| mv dist\MusicBrainz-Picard-*.exe dist\MusicBrainz-Picard-daily.exe | |
| env: | |
| PICARD_BUILD_PORTABLE: 1 | |
| - name: Azure login | |
| uses: azure/login@v2 | |
| if: env.CODESIGN == 'true' | |
| with: | |
| client-id: ${{ secrets.AZURE_CLIENT_ID }} | |
| tenant-id: ${{ secrets.AZURE_TENANT_ID }} | |
| subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | |
| enable-AzPSSession: true | |
| - name: Code signing | |
| uses: azure/artifact-signing-action@v1 | |
| if: env.CODESIGN == 'true' | |
| with: | |
| endpoint: ${{ secrets.AZURE_ENDPOINT }} | |
| 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' || startsWith( github.ref, 'refs/tags' ) }} | |
| 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} |