Skip to content

Commit 835905a

Browse files
authored
CI: consolidate logic for arm64 and intel mac builds (#1710)
- These can be setup as a matrix since nearly all the steps are the same - Also bump the Linux build to the latest default runner
1 parent e0a63aa commit 835905a

1 file changed

Lines changed: 11 additions & 50 deletions

File tree

.github/workflows/build.yml

Lines changed: 11 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ env:
1717

1818
jobs:
1919
build-ubuntu:
20-
runs-on: ubuntu-22.04
20+
runs-on: ubuntu-24.04
2121

2222
# Test building with .NET 8 and .NET 9
2323
strategy:
@@ -71,54 +71,15 @@ jobs:
7171
path: pinta-3.1.zip
7272
if-no-files-found: error
7373

74-
build-macos-x86_64:
75-
runs-on: macos-13
76-
77-
steps:
78-
- uses: actions/checkout@v5
79-
- name: Setup .NET
80-
uses: actions/setup-dotnet@v4
81-
with:
82-
dotnet-version: ${{env.DOTNET_VERSION}}
83-
- name: Install Dependencies
84-
env:
85-
# Work around webp-pixbuf-loader issue: https://github.com/Homebrew/homebrew-core/issues/139497
86-
HOMEBREW_NO_INSTALL_FROM_API: 1
87-
run: brew install libadwaita adwaita-icon-theme gettext webp-pixbuf-loader
88-
- name: Build
89-
run: dotnet build Pinta.sln -c Release
90-
- name: Test
91-
env:
92-
# Add libraries from homebrew to the search path so they can be loaded by gir.core
93-
DYLD_LIBRARY_PATH: "/usr/local/lib"
94-
run: dotnet test Pinta.sln -c Release
95-
96-
- name: Add Cert to Keychain
97-
if: github.event_name != 'pull_request'
98-
uses: apple-actions/import-codesign-certs@v5
99-
with:
100-
p12-file-base64: ${{ secrets.MAC_CERTS_BASE64 }}
101-
p12-password: ${{ secrets.MAC_CERTS_PASSWORD }}
102-
103-
- name: Build Installer
104-
if: github.event_name != 'pull_request'
105-
env:
106-
MAC_DEV_PASSWORD: ${{ secrets.MAC_DEV_PASSWORD }}
107-
run: |
108-
cd installer/macos
109-
./build_installer.sh osx-x64
74+
build-macos:
75+
# Build for both intel and arm64
76+
strategy:
77+
matrix:
78+
build: [ { dotnet_rid: osx-arm64, lib_path: "/opt/homebrew/lib", runner: macos-14 }, { dotnet_rid: osx-x64, lib_path: "/usr/local/lib", runner: macos-13 }]
11079

111-
- name: Upload Installer
112-
if: github.event_name != 'pull_request'
113-
uses: actions/upload-artifact@v4
114-
with:
115-
name: "Pinta-x86_64.dmg"
116-
path: installer/macos/Pinta.dmg
117-
if-no-files-found: error
80+
name: build-macos (${{matrix.build.dotnet_rid}})
11881

119-
build-macos-arm64:
120-
# Note the macos-14 runner is arm64, while the macos-13 runner is Intel
121-
runs-on: macos-14
82+
runs-on: ${{matrix.build.runner}}
12283

12384
steps:
12485
- uses: actions/checkout@v5
@@ -136,7 +97,7 @@ jobs:
13697
- name: Test
13798
env:
13899
# Add libraries from homebrew to the search path so they can be loaded by gir.core
139-
DYLD_LIBRARY_PATH: "/opt/homebrew/lib"
100+
DYLD_LIBRARY_PATH: ${{matrix.build.lib_path}}
140101
run: dotnet test Pinta.sln -c Release
141102

142103
- name: Add Cert to Keychain
@@ -152,13 +113,13 @@ jobs:
152113
MAC_DEV_PASSWORD: ${{ secrets.MAC_DEV_PASSWORD }}
153114
run: |
154115
cd installer/macos
155-
./build_installer.sh osx-arm64
116+
./build_installer.sh ${{matrix.build.dotnet_rid}}
156117
157118
- name: Upload Installer
158119
if: github.event_name != 'pull_request'
159120
uses: actions/upload-artifact@v4
160121
with:
161-
name: "Pinta-arm64.dmg"
122+
name: "Pinta-${{matrix.build.dotnet_rid}}.dmg"
162123
path: installer/macos/Pinta.dmg
163124
if-no-files-found: error
164125

0 commit comments

Comments
 (0)