Skip to content
Merged
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
44 changes: 26 additions & 18 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:

env:
JOB_TRANSFER_ARTIFACT: build-artifacts
NODE_VERSION: 18.17
NODE_VERSION: 20.18

jobs:
build:
Expand All @@ -23,12 +23,14 @@ jobs:
fail-fast: false
matrix:
config:
- os: macos-latest
id: macos-universal
- os: [self-hosted, windows-sign-pc]
id: windows
- os: ubuntu-latest
id: linux
- os: macos-latest
id: macos-universal
id: linux-x64
- os: ubuntu-22.04-arm
id: linux-arm64
runs-on: ${{ matrix.config.os }}
timeout-minutes: 90

Expand Down Expand Up @@ -98,6 +100,7 @@ jobs:
with:
name: ${{ env.JOB_TRANSFER_ARTIFACT }}-${{ matrix.config.id }}
path: dist
overwrite: true

artifacts:
name: ${{ matrix.artifact.name }} artifact
Expand All @@ -108,34 +111,41 @@ jobs:
strategy:
matrix:
artifact:
- path: "*-linux_x64.zip"
name: Arduino-Lab-for-MicroPython_Linux_X86-64
id: linux
- path: "*-mac_universal.zip"
name: Arduino-Lab-for-MicroPython_macOS_Universal
id: macos-universal
- path: "*-win_x64.zip"
name: Arduino-Lab-for-MicroPython_Windows_X86-64
id: windows
- path: "*-linux_x64.zip"
name: Arduino-Lab-for-MicroPython_Linux_X86-64
id: linux-x64
- path: "*-linux_arm64.zip"
name: Arduino-Lab-for-MicroPython_Linux_ARM64
id: linux-arm64

# keep for future implementation
# Windows - installers (future)
# - path: "*Windows_64bit.exe"
# name: Windows_X86-64_interactive_installer
# id: windows
# - path: "*Windows_64bit.msi"
# name: Windows_X86-64_MSI
# id: windows
- path: "*-win_x64.zip"
name: Arduino-Lab-for-MicroPython_Windows_X86-64
id: windows


steps:
- name: Download job transfer artifact
uses: actions/download-artifact@v4
with:
name: ${{ env.JOB_TRANSFER_ARTIFACT }}-${{ matrix.artifact.id }}
path: ${{ env.JOB_TRANSFER_ARTIFACT }}

- name: Upload tester build artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact.name }}
path: ${{ env.JOB_TRANSFER_ARTIFACT }}/${{ matrix.artifact.path }}
overwrite: true

release:
needs: build
Expand All @@ -145,7 +155,9 @@ jobs:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
pattern: build-artifacts-*
path: artifacts
merge-multiple: true

- name: List artifacts
run: ls -R artifacts
Expand All @@ -172,13 +184,9 @@ jobs:
- artifacts
if: always() && needs.build.result != 'skipped'
runs-on: ubuntu-latest

steps:
- name: Remove unneeded job transfer artifacts
uses: geekyeggo/delete-artifact@v2
uses: geekyeggo/delete-artifact@v5
with:
name: |
${{ env.JOB_TRANSFER_ARTIFACT }}-windows
${{ env.JOB_TRANSFER_ARTIFACT }}-linux
${{ env.JOB_TRANSFER_ARTIFACT }}-macos-x64
${{ env.JOB_TRANSFER_ARTIFACT }}-macos-arm64
name: ${{ env.JOB_TRANSFER_ARTIFACT }}-*

43 changes: 43 additions & 0 deletions build_resources/electron-rebuild.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
const { execSync } = require('child_process');
const fs = require('fs');
const os = require('os');

console.log('System info:', {
arch: process.arch,
platform: process.platform,
osArch: os.arch(),
osType: os.type()
});

if (process.platform === 'linux' && (process.arch === 'arm64' || os.arch() === 'arm64')) {
console.log('Configuring for ARM64 build...');

const npmrcContent = `target_arch=arm64
target_platform=linux
disturl=https://electronjs.org/headers
runtime=electron
cache=/tmp/.npm
build_from_source=true`;

fs.writeFileSync('.npmrc', npmrcContent);

// Clear cached builds
execSync('rm -rf node_modules/@serialport/bindings-cpp/build', { stdio: 'inherit' });

try {
execSync('npx @electron/rebuild --arch=arm64 --force', {
stdio: 'inherit',
env: {
...process.env,
TARGET_ARCH: 'arm64',
npm_config_target_arch: 'arm64',
ELECTRON_REBUILD_ARCH: 'arm64'
}
});
} catch (error) {
console.error('ARM64 rebuild failed');
process.exit(1);
}
} else {
execSync('npx @electron/rebuild', { stdio: 'inherit' });
}
2 changes: 1 addition & 1 deletion build_resources/notarize.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// along with this program. If not, see <https://www.gnu.org/licenses/>.

const isCI = require('is-ci');
const { notarize } = require('electron-notarize');
const { notarize } = require('@electron/notarize');

exports.default = async function notarizing(context) {
if (!isCI) {
Expand Down
Loading
Loading