Skip to content

Commit

Permalink
Merge pull request #1454 from qdraw/feature/202403-mac-arm64-try2
Browse files Browse the repository at this point in the history
Feature/202403 mac arm64 mk2
  • Loading branch information
qdraw authored Mar 11, 2024
2 parents dd14bb4 + f5bf8a2 commit 76a3507
Show file tree
Hide file tree
Showing 28 changed files with 1,823 additions and 1,075 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: SonarQube Desktop .NET Analyze (Missing .NET dependency)

on:
workflow_dispatch:
pull_request:
types:
- synchronize
- opened
branches:
- master
paths:
- 'starskydesktop/**'
- '.github/workflows/**'
push:
branches: [master]
paths:
- 'starsky/**'
schedule:
- cron: '36 0 * * 0,2,4,6'

env:
PR_NUMBER_GITHUB: ${{ github.event.pull_request.number }}

jobs:
build:

runs-on: ubuntu-latest

env:
WEBSITE_SITE_NAME: "ci"

steps:
- name: 'Checkout repository on branch: ${{ github.REF }}'
uses: actions/checkout@v4
with:
ref: ${{ github.HEAD_REF }}

- name: Retrieve entire repository history
run: |
git fetch --prune --unshallow
- name: Use Java 17
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
check-latest: true
java-package: jdk # (jre, jdk, or jdk+fx) - defaults to jdk
architecture: x64 # (x64 or x86) - defaults to x64

- name: Cache sonarqube packages (*nix)
uses: actions/cache@v4
with:
# nuget cache files are stored in `~/.sonar` on Linux/macOS
path: ~/.sonar
key: ${{ runner.os }}-build-desktop-sonarqube
restore-keys: |
${{ runner.os }}-build-desktop-sonarqube-
- name: NpmCi
working-directory: ./starskydesktop
run: npm ci

- name: Test
working-directory: ./starskydesktop
env:
STARSKY_SONAR_KEY: ${{ secrets.STARSKY_SONAR_KEY }}
STARSKY_SONAR_TOKEN: ${{ secrets.STARSKY_SONAR_TOKEN }}
STARSKY_SONAR_ORGANISATION: ${{ secrets.STARSKY_SONAR_ORGANISATION }}
STARSKY_SONAR_URL: ${{ secrets.STARSKY_SONAR_URL }}
run: npm run test:ci


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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,10 @@ starskyapp/tmp/settings.json
starskydesktop/dist-prod/*
starskydesktop/tmp/settings.json

starskydesktop/.scannerwork/**
starskydesktop/src/.scannerwork/**


starsky-tools/docs/*.yml
starsky-tools/docs/*.sh
starsky-tools/docs/*/*.sh
Expand Down
4 changes: 2 additions & 2 deletions documentation/docs/developer-guide/github-actions/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -271,9 +271,9 @@ Smoke tests for the starsky-tools
Build the Electron app on pull request without .NET so faster but does not run the app
For Windows and Mac OS builds the app and runs the unit tests

[![Docker buildx multi-arch CI unstable master](https://github.com/qdraw/starsky/actions/workflows/starskyapp-electron-pr-build-mac-win.yml/badge.svg)](https://github.com/qdraw/starsky/actions/workflows/starskyapp-electron-pr-build-mac-win.yml)
[![Docker buildx multi-arch CI unstable master](https://github.com/qdraw/starsky/actions/workflows/desktop-electron-pr-build-mac-win.yml/badge.svg)](https://github.com/qdraw/starsky/actions/workflows/desktop-electron-pr-build-mac-win.yml)

> [starskyapp-electron-pr-build-mac-win.yml](https://github.com/qdraw/starsky/actions/workflows/starskyapp-electron-pr-build-mac-win.yml)
> [desktop-electron-pr-build-mac-win.yml](https://github.com/qdraw/starsky/actions/workflows/desktop-electron-pr-build-mac-win.yml)
## storybook clientapp netlify

Expand Down
2 changes: 2 additions & 0 deletions history.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ Semantic Versioning 2.0.0 is from version 0.1.6+
- [x] (Fixed) _Front-end_ Fix list item status OkAndSame is not red anymore (PR #1445)
- [x] (Removed) _Back-end_ Unused .NET cultures (PR #1453)
- [x] (Changed) _Back-end_ Change GetParentPath() to avoid regex due timeout (PR #1461)
- [x] (Added) _Desktop_ Add support for Apple Silicon Mac OS in Desktop App (PR #1454)
- [x] (Added) _Desktop_ SonarScanner for Desktop App (PR #1454)

## version 0.6.0-beta.2 - 2024-03-05 {#v0.6.0-beta.2}

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'
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ _See `./pipelines/azure` for details_

The pipeline below is to test the Desktop build process. The .NET part isn't build in this pipeline, but it's needed to run the Desktop app.

[![starskyDesktop Electron PR (Missing .NET dependency)](https://github.com/qdraw/starsky/actions/workflows/starskyapp-electron-pr-build-mac-win.yml/badge.svg)](https://github.com/qdraw/starsky/actions/workflows/starskyapp-electron-pr-build-mac-win.yml)
[![starskyDesktop Electron PR (Missing .NET dependency)](https://github.com/qdraw/starsky/actions/workflows/desktop-electron-pr-build-mac-win.yml/badge.svg)](https://github.com/qdraw/starsky/actions/workflows/desktop-electron-pr-build-mac-win.yml)

A full build including the .NET dependency

Expand Down
2 changes: 1 addition & 1 deletion starskydesktop/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const baseConfig = {
"prefer-promise-reject-errors": ["off"],
"linebreak-style": ["off"],
},
ignorePatterns: ["dist/*", "dist-prod/*", "runtime-*/*"],
ignorePatterns: ["dist/*", "dist-prod/*", "runtime-*/*", "sonar-scanner.js"],
};

const tsConfig = {
Expand Down
1 change: 1 addition & 0 deletions starskydesktop/jest.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export default {
'!runtime-starsky-win-x64/**',
'!runtime-starsky-mac-arm64/**',
'!runtime-starsky-linux-x64/**',
'!src/setup/**',
'!dist/**',
'!dist-prod/**',
],
Expand Down
Loading

0 comments on commit 76a3507

Please sign in to comment.