From 022a616303c1d17e04f83227a064035a80781344 Mon Sep 17 00:00:00 2001 From: Sebastian Richner Date: Tue, 29 Oct 2024 10:56:33 -0700 Subject: [PATCH] Update build --- .github/workflows/build.yml | 27 +++++++++++++++++++-------- src/electron/package.json | 4 ++-- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d98baf2d..6005a6d0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,7 +16,14 @@ jobs: working-directory: src/electron strategy: matrix: - os: [ macos-latest, windows-latest ] + os: [windows-latest, macos-latest] + mac_arch: [arm64, x64] + include: + - os: windows-latest + - os: macos-latest + mac_arch: arm64 + - os: macos-latest + mac_arch: x64 steps: - uses: actions/checkout@v4 with: @@ -26,15 +33,19 @@ jobs: with: node-version: ${{ env.NODE_VERSION }} - name: Install dependencies + run: npm ci + - name: Build run: | - npm ci - - name: Build windows - run: npm run build - if: matrix.os == 'windows-latest' - - name: Build macos - run: npm run build - if: matrix.os == 'macos-latest' + if [ "${{ matrix.os }}" == "macos-latest" ]; then + if [ "${{ matrix.mac_arch }}" == "arm64" ]; then + npm run build:mac:arm64 + else + npm run build:mac:x64 + fi + else + npm run build env: + MAC_ARCH_TYPE: ${{ matrix.mac_arch == 'arm64' && 'AppleSilicon' || 'Intel' }} APPLE_ID: ${{ secrets.APPLE_ID }} APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }} APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} diff --git a/src/electron/package.json b/src/electron/package.json index 2074d73b..6ef16640 100644 --- a/src/electron/package.json +++ b/src/electron/package.json @@ -11,8 +11,8 @@ "dev": "vite", "build": "vue-tsc --noEmit && vite build && electron-builder --config electron-builder.config.cjs", "build:mac": "npm run build:mac:arm64 && npm run build:mac:x64", - "build:mac:arm64": "export MAC_ARCH_TYPE=AppleSilicon && vue-tsc --noEmit && vite build && electron-builder --mac --arm64 --config electron-builder.config.cjs", - "build:mac:x64": "export MAC_ARCH_TYPE=Intel && vue-tsc --noEmit && vite build && electron-builder --mac --x64 --config electron-builder.config.cjs", + "build:mac:arm64": "vue-tsc --noEmit && vite build && electron-builder --mac --arm64 --config electron-builder.config.cjs", + "build:mac:x64": "vue-tsc --noEmit && vite build && electron-builder --mac --x64 --config electron-builder.config.cjs", "build:win": "vue-tsc --noEmit && vite build && electron-builder --win --config electron-builder.config.cjs", "postinstall": "electron-builder install-app-deps", "preview": "vite preview",