Skip to content

Commit 59db7c0

Browse files
authored
Add macOS ARM64 (Apple Silicon) support (#93)
* Add macOS ARM64 (Apple Silicon) support * Restore line endings
1 parent da7edaf commit 59db7c0

3 files changed

Lines changed: 29 additions & 10 deletions

File tree

.github/workflows/release.yml

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,20 @@ jobs:
6262
- name: Upload osx-x64 artifacts
6363
uses: actions/upload-artifact@v4.3.5
6464
with:
65-
name: publish-osx
65+
name: publish-osx-x64
66+
path: .publish
67+
68+
- name: Restore osx-arm64 dependencies
69+
run: dotnet restore -r osx-arm64
70+
- name: Build osx-arm64
71+
run: msbuild SQLSchemaCompare.sln /p:Configuration=Release /p:RuntimeIdentifier=osx-arm64
72+
- name: Publish osx-arm64
73+
run: dotnet publish SQLSchemaCompare.UI.csproj --no-build --no-restore -c Release -r osx-arm64
74+
working-directory: SQLSchemaCompare.UI
75+
- name: Upload osx-arm64 artifacts
76+
uses: actions/upload-artifact@v4.3.5
77+
with:
78+
name: publish-osx-arm64
6679
path: .publish
6780

6881
installer_win_x64:
@@ -134,9 +147,12 @@ jobs:
134147
file: installer/*.{deb,rpm,tar.gz}
135148
tag: ${{ github.ref }}
136149

137-
installer_osx_x64:
150+
installer_osx:
138151
runs-on: macos-latest
139152
needs: build_artifacts
153+
strategy:
154+
matrix:
155+
arch: [x64, arm64]
140156
defaults:
141157
run:
142158
shell: bash
@@ -150,10 +166,10 @@ jobs:
150166
with:
151167
name: SQLSchemaCompare
152168
path: SQLSchemaCompare
153-
- name: Download publish-osx artifact
169+
- name: Download publish-osx-${{ matrix.arch }} artifact
154170
uses: actions/download-artifact@v4
155171
with:
156-
name: publish-osx
172+
name: publish-osx-${{ matrix.arch }}
157173
path: .publish
158174
- name: Prepare artifacts
159175
run: |
@@ -163,8 +179,10 @@ jobs:
163179
cd SQLSchemaCompare
164180
yarn install --frozen-lockfile
165181
- name: Create installer
166-
run: yarn dist-osx-x64
182+
run: yarn dist-osx
167183
working-directory: SQLSchemaCompare
184+
env:
185+
ARCH_SUFFIX: ${{ matrix.arch }}
168186
- name: Upload installer to release
169187
uses: svenstaro/upload-release-action@v2
170188
with:
@@ -176,12 +194,13 @@ jobs:
176194
clean_artifacts:
177195
runs-on: windows-latest
178196
if: always()
179-
needs: [installer_win_x64, installer_linux_x64, installer_osx_x64]
197+
needs: [installer_win_x64, installer_linux_x64, installer_osx]
180198
steps:
181199
- uses: geekyeggo/delete-artifact@v5
182200
with:
183201
name: |
184202
SQLSchemaCompare
185203
publish-win
186204
publish-linux
187-
publish-osx
205+
publish-osx-x64
206+
publish-osx-arm64

SQLSchemaCompare.UI/SQLSchemaCompare.UI.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<RootNamespace>TiCodeX.SQLSchemaCompare.UI</RootNamespace>
55
<TypeScriptToolsVersion>latest</TypeScriptToolsVersion>
66
<OutputType>Exe</OutputType>
7-
<RuntimeIdentifiers>win-x64;linux-x64;osx-x64</RuntimeIdentifiers>
7+
<RuntimeIdentifiers>win-x64;linux-x64;osx-x64;osx-arm64</RuntimeIdentifiers>
88
<PublishDir>..\.publish</PublishDir>
99
<SelfContained>true</SelfContained>
1010
</PropertyGroup>

SQLSchemaCompare/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
"mac": {
5656
"target": "default",
5757
"category": "public.app-category.productivity",
58-
"artifactName": "SQLSchemaCompare-${version}.${ext}",
58+
"artifactName": "SQLSchemaCompare-${version}-${env.ARCH_SUFFIX}.${ext}",
5959
"publish": {
6060
"provider": "generic",
6161
"url": ""
@@ -106,7 +106,7 @@
106106
"start": "electron .",
107107
"dist-win-x64": "electron-builder --win --publish always",
108108
"dist-linux-x64": "electron-builder --linux --publish always",
109-
"dist-osx-x64": "electron-builder --mac --publish always"
109+
"dist-osx": "electron-builder --mac --publish always"
110110
},
111111
"postinstall": "electron-builder install-app-deps",
112112
"devDependencies": {

0 commit comments

Comments
 (0)