Build #522
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: 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-20.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- 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@v4 | |
with: | |
name: AppImage | |
path: MusicBrainz-Picard*.AppImage* | |
windows-portable: | |
name: Build Windows portable | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
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 | |
- 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.4 | |
DISCID_SHA256SUM: 330199495d71f71251e91eb0b4e3103b6c663fea09ffc9fd3e5108d48e0452c8 | |
FPCALC_VERSION: 1.5.1 | |
FPCALC_SHA256SUM: 36b478e16aa69f757f376645db0d436073a42c0097b6bb2677109e7835b59bbc | |
- 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") | |
& .\scripts\package\win-package-portable.ps1 -BuildNumber $BuildNumber | |
mv dist\MusicBrainz-Picard-*.exe dist\MusicBrainz-Picard-daily.exe | |
- name: Archive artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Windows | |
path: source/dist/*.exe | |
upload: | |
name: Create release and upload artifacts | |
runs-on: ubuntu-latest | |
needs: | |
- appimage | |
- windows-portable | |
steps: | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
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} |