Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mac arm64 support #1425

Closed
wants to merge 12 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 69 additions & 12 deletions .github/workflows/release-on-tag-netcore-desktop-electron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ on:

jobs:

build_core:
build_net:

name: Build Net Core
name: Build .NET
runs-on: ubuntu-latest
steps:
- name: Checkout code
Expand Down Expand Up @@ -71,10 +71,10 @@ jobs:
name: starsky-tools-slack-notification
path: ./starsky-tools/slack-notification

build_mac:
name: Update Mac Desktop app
build_mac_x64:
name: Build Mac Desktop app (x64)
runs-on: macos-latest
needs: [build_core]
needs: [build_net]
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -85,7 +85,7 @@ jobs:
name: osx-x64
path: ./starsky

- name: Unzip Mac OS bundle
- name: Unzip Mac OS bundle (osx-x64)
shell: bash
working-directory: ./starsky
run: unzip starsky-osx-x64.zip -d osx-x64
Expand Down Expand Up @@ -116,18 +116,66 @@ jobs:

- name: NpmDist
working-directory: ./starskydesktop
run: npm run mac
run: npm run macx64

- name: Upload starsky-mac-x64-desktop as build artifact
uses: actions/upload-artifact@v4
with:
name: starsky-mac-x64-desktop
path: ./starskydesktop/dist-prod/starsky-mac-x64-desktop.dmg

build_mac_arm64:
name: Build Mac Desktop app (arm64)
runs-on: macos-latest
needs: [build_net]
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Download osx-arm64 as build artifact
uses: actions/download-artifact@v4
with:
name: osx-arm64
path: ./starsky

- name: Unzip Mac OS bundle (osx-arm64)
shell: bash
working-directory: ./starsky
run: unzip starsky-osx-arm64.zip -d osx-arm64

- name: Restore rights pm2-restore-x-rights.sh (osx-arm64)
shell: bash
working-directory: ./starsky/osx-arm64
run: chmod 777 pm2-restore-x-rights.sh

- name: run pm2-restore-x-rights.sh (osx-arm64)
shell: bash
working-directory: ./starsky/osx-arm64
run: bash pm2-restore-x-rights.sh

- name: fix release version (release-version-check)
shell: bash
working-directory: ./starsky-tools/build-tools
run: npm run release-version-check

- name: NpmCi
working-directory: ./starskydesktop
run: npm ci

- name: NpmDist
working-directory: ./starskydesktop
run: npm run macarm64

- name: Upload starsky-mac-arm64-desktop as build artifact
uses: actions/upload-artifact@v4
with:
name: starsky-mac-arm64-desktop
path: ./starskydesktop/dist-prod/starsky-mac-arm64-desktop.dmg

build_win:
name: Update Windows Desktop app
name: Build Windows Desktop app
runs-on: windows-latest
needs: [build_core]
needs: [build_net]
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down Expand Up @@ -169,7 +217,7 @@ jobs:

create_release:
name: Create Release
needs: [build_core, build_mac, build_win]
needs: [build_net, build_mac_x64, build_mac_arm64, build_win]
runs-on: ubuntu-latest
permissions:
contents: write
Expand All @@ -192,6 +240,12 @@ jobs:
with:
name: starsky-mac-x64-desktop
path: ./starskydesktop/dist-prod

- name: Download starsky-mac-arm64-desktop as build artifact
uses: actions/download-artifact@v4
with:
name: starsky-mac-arm64-desktop
path: ./starskydesktop/dist-prod

- name: Download linux-arm as build artifact
uses: actions/download-artifact@v4
Expand Down Expand Up @@ -246,6 +300,7 @@ jobs:
tag_name: ${{ github.ref }}
files: |
./starskydesktop/dist-prod/starsky-mac-x64-desktop.dmg
./starskydesktop/dist-prod/starsky-mac-arm64-desktop.dmg
./starskydesktop/dist-prod/starsky-win-x64-desktop.exe
./starsky/starsky-linux-arm.zip
./starsky/starsky-linux-arm64.zip
Expand All @@ -258,7 +313,8 @@ jobs:
body: |
## Desktop app versions:
_When you are not sure pick the Desktop App_
- starsky-mac-x64-desktop.dmg - __Starsky Desktop App for Mac OS *12.0* or newer (Intel)__
- starsky-mac-x64-desktop.dmg - __Starsky Desktop App for Intel, Mac OS *12.0* or newer__
- starsky-mac-arm64-desktop.dmg - __Starsky Desktop App for Apple silicon, Mac OS *12.0* or newer__
- starsky-win-x64-desktop.exe - __Starsky Desktop App for Windows 10 1607+ or Windows 11 22000+ (Intel 64 bits)__

## Server versions:
Expand Down Expand Up @@ -318,7 +374,8 @@ jobs:
trigger_pipe:
runs-on: ubuntu-latest
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
needs: [build_core, build_mac, build_win]
needs: [build_net, build_mac_x64, build_win, build_mac_arm64]
# build_mac_arm64 is not used for end2end tests, but it needs to be done
steps:
- name: trigger end2end-ubuntu-ci.yml
shell: bash
Expand Down
6 changes: 6 additions & 0 deletions pipelines/azure/app-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,3 +124,9 @@ stages:
inputs:
path: '$(Build.SourcesDirectory)/starskydesktop/dist-prod/starsky-mac-x64-desktop.zip'
ArtifactName: 'starsky-mac-x64-desktop'

- task: PublishPipelineArtifact@1
displayName: 'Publish Artifact: starsky-mac-arm64-desktop'
inputs:
path: '$(Build.SourcesDirectory)/starskydesktop/dist-prod/starsky-mac-x64-desktop.zip'
ArtifactName: 'starsky-mac-arm64-desktop'
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,6 @@ internal DbContextOptions<ApplicationDbContext> BuilderDbFactorySwitch(
public void BuilderDb(string? foundationDatabaseName = "")
{
if ( _services == null ) throw new AggregateException("services is missing");
if ( _logger != null && _appSettings.IsVerbose() )
{
_logger.LogInformation($"Database connection: {_appSettings.DatabaseConnection}");
}

_services.AddScoped(_ =>
new ApplicationDbContext(BuilderDbFactorySwitch(foundationDatabaseName)));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,20 +87,5 @@ public void BuilderDb_fail()
new SetupDatabaseTypes(appSettings).BuilderDb();
// expect exception
}

[TestMethod]
public void BuilderDb_console()
{
var console = new FakeIWebLogger();
var appSettings = new AppSettings
{
Verbose = true, DatabaseType = AppSettings.DatabaseTypeList.InMemoryDatabase
};
var services = new ServiceCollection();

new SetupDatabaseTypes(appSettings, services, console).BuilderDb();

Assert.IsTrue(console.TrackedInformation[0].Item2?.Contains("Database connection:"));
}
}
}
15 changes: 8 additions & 7 deletions starskydesktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@
"test:ci": "npm run jest && npm run lint",
"test-ci": "npm run jest && npm run lint",
"windows": "npm run prod && electron-builder build --win --publish never",
"mac": "npm run prod && electron-builder build --mac --publish never",
"mac": "npm run prod && electron-builder build --mac --x64 --arm64 --publish never",
"macx64": "npm run prod && electron-builder build --mac --x64 --publish never",
"macarm64": "npm run prod && electron-builder build --mac --arm64 true --x64 false --publish never",
"macwindows": "npm run prod && echo prod-done && electron-builder build --mac zip --windows --publish never",
"linux": "npm run prod && electron-builder build --linux --publish never",
"dist": "npm run prod && electron-builder build --publish never",
"build:win": "electron-builder build --win",
"build:mac": "electron-builder build --mac",
"build:win": "electron-builder build --win ",
"build:mac": "electron-builder build --mac --x64 true --arm64 true",
"build:runtime": "cd ../starsky && pwsh build.ps1 -runtime osx-arm64,osx-x64,win-x64 -ready-to-run -no-tests",
"update": "npx --yes npm-check-updates",
"update:install": "npx --yes npm-check-updates -u && npm install",
Expand All @@ -42,16 +43,16 @@
],
"artifactName": "starsky-${os}-${arch}-desktop.${ext}",
"mac": {
"minimumSystemVersion": "10.14",
"minimumSystemVersion": "10.15",
"electronLanguages": [
"en",
"nl"
"nl",
"de"
],
"icon": "src/setup/icons/baseline-searcher-detective-263238__512px.icns",
"target": [
{
"target": "dmg",
"arch": "x64"
"target": "dmg"
}
],
"publish": []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as fs from "fs";
import * as readline from "readline";
import * as GetPortProxy from "../get-free-port/get-free-port";
import logger from "../logger/logger";
import { setupChildProcess } from "./setup-child-process";
import { SetupChildProcess } from "./setup-child-process";

jest.mock("child_process", () => {
return {
Expand Down Expand Up @@ -84,7 +84,7 @@ describe("setupChildProcess", () => {
return null;
});

await setupChildProcess();
await SetupChildProcess();

expect(mkdirSpy).toHaveBeenCalled();
expect(mkdirSpy).toHaveBeenCalledTimes(2);
Expand Down
Loading
Loading