Skip to content

Commit

Permalink
CI/CD: special treatment for Windows on ARM.
Browse files Browse the repository at this point in the history
Indeed, GHA doesn't currently have WoA runners.
  • Loading branch information
agarny committed Jan 30, 2025
1 parent 8f81d90 commit a566eae
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 18 deletions.
32 changes: 24 additions & 8 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ on:
types: [created]
workflow_dispatch:

defaults:
run:
shell: bash

jobs:
cd:
name: ${{ matrix.name }}
Expand All @@ -15,22 +19,16 @@ jobs:
include:
- name: Windows (Intel)
os: windows-2022
node_architecture: x64
- name: Windows (ARM)
os: windows-2019
node_architecture: arm64
- name: Linux (Intel)
os: ubuntu-22.04
node_architecture: x64
- name: Linux (ARM)
os: ubuntu-22.04-arm
node_architecture: arm64
- name: macOS (Intel)
os: macos-13
node_architecture: x64
- name: macOS (ARM)
os: macos-14
node_architecture: arm64
env:
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }}
Expand All @@ -41,6 +39,7 @@ jobs:
MACOS_CSC_LINK: DeveloperIDApplicationCertificate.p12
MACOS_CSC_KEY_PASSWORD: ${{ secrets.DEVELOPER_ID_APPLICATION_CERTIFICATE_PASSWORD }}
DEVELOPER_ID_APPLICATION_CERTIFICATE_BASE64: ${{ secrets.DEVELOPER_ID_APPLICATION_CERTIFICATE_BASE64 }}
ELECTRON_VERSION: 34.0.2
steps:
- name: Set the timezone to New Zealand
uses: szenius/[email protected]
Expand All @@ -66,7 +65,6 @@ jobs:
- name: Install Node.js
uses: actions/setup-node@v4
with:
architecture: ${{ matrix.node_architecture }}
node-version: 'lts/*'
- name: Install pnpm
run: npm install -g pnpm
Expand All @@ -77,8 +75,26 @@ jobs:
sudo apt install libopenjp2-tools
- name: OpenCOR dependencies
run: pnpm install
- name: Package OpenCOR
- name: Fix OpenCOR's dependencies (Windows on ARM only)
if: ${{ (matrix.name == 'Windows (ARM)') }}
run: |
choco install wget unzip
cd node_modules/electron
rm -fr dist
mkdir dist
cd dist
wget https://github.com/electron/electron/releases/download/v$ELECTRON_VERSION/electron-v$ELECTRON_VERSION-win32-arm64.zip -O electron.zip
unzip electron.zip
rm electron.zip
- name: Package OpenCOR (all platforms except Windows on ARM)
if: ${{ matrix.name != 'Windows (ARM)' }}
run: pnpm package
- name: Package OpenCOR (Windows on ARM only)
if: ${{ matrix.name == 'Windows (ARM)' }}
run: |
pnpm cmake-js build -a arm64 -B Release -O out/libOpenCOR
pnpm electron-vite build
pnpm electron-builder --arm64
- name: Remove blockmap files
shell: bash
run: find ./dist -name '*.blockmap' -delete
Expand Down
36 changes: 26 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ on:
branches: [main]
workflow_dispatch:

defaults:
run:
shell: bash

jobs:
ci:
name: ${{ matrix.name }}
Expand All @@ -15,28 +19,22 @@ jobs:
include:
- name: Windows (Intel)
os: windows-2022
node_architecture: x64
- name: Windows (ARM)
os: windows-2019
node_architecture: arm64
- name: Linux (Intel)
os: ubuntu-22.04
node_architecture: x64
- name: Linux (ARM)
os: ubuntu-22.04-arm
node_architecture: arm64
- name: macOS (Intel)
os: macos-13
node_architecture: x64
- name: macOS (ARM)
os: macos-14
node_architecture: arm64
- name: Code formatting
os: ubuntu-22.04
node_architecture: x64
- name: Linting
os: ubuntu-22.04
node_architecture: x64
env:
ELECTRON_VERSION: 34.0.2
steps:
- name: Check out OpenCOR
uses: actions/checkout@v4
Expand All @@ -45,15 +43,33 @@ jobs:
- name: Install Node.js
uses: actions/setup-node@v4
with:
architecture: ${{ matrix.node_architecture }}
node-version: 'lts/*'
- name: Install pnpm
run: npm install -g pnpm
- name: OpenCOR dependencies
run: pnpm install
- name: Build OpenCOR
- name: Fix OpenCOR's dependencies (Windows on ARM only)
if: ${{ matrix.name == 'Windows (ARM)' }}
run: |
choco install wget unzip
cd node_modules/electron
rm -fr dist
mkdir dist
cd dist
wget https://github.com/electron/electron/releases/download/v$ELECTRON_VERSION/electron-v$ELECTRON_VERSION-win32-arm64.zip -O electron.zip
unzip electron.zip
rm electron.zip
- name: Build OpenCOR (all platforms except Windows on ARM)
if: ${{ (matrix.name != 'Code formatting') && (matrix.name != 'Linting') }}
run: pnpm build
- name: Build OpenCOR (all platforms except Windows on ARM)
if: ${{ (matrix.name != 'Windows (ARM)') && (matrix.name != 'Code formatting') && (matrix.name != 'Linting') }}
run: pnpm build
- name: Build OpenCOR (Windows on ARM only)
if: ${{ matrix.name == 'Windows (ARM)' }}
run: |
pnpm cmake-js build -a arm64 -B Release -O out/libOpenCOR
pnpm electron-vite build
- name: Build OpenCOR's Web app
if: ${{ (matrix.name != 'Code formatting') && (matrix.name != 'Linting') }}
run: pnpm build:web
Expand Down

0 comments on commit a566eae

Please sign in to comment.