-
-
Notifications
You must be signed in to change notification settings - Fork 0
136 lines (131 loc) · 4.83 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
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
env:
CODESIGN: ${{ !!secrets.AZURE_CERT_PROFILE_NAME }}
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")
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/[email protected]
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@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}