Skip to content

Commit c21a951

Browse files
committed
fix: notarize.jsのnotarizeインポート位置を修正し、依存関係を更新
feat: Raspberry Pi用のビルドワークフローを整理し、arm64およびarmv7lのビルド手順を追加 chore: package.jsonおよびpackage-lock.jsonの依存関係を更新
1 parent 8c1df02 commit c21a951

6 files changed

Lines changed: 254 additions & 71 deletions

File tree

.erb/scripts/notarize.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
const { notarize } = require('@electron/notarize');
21
const { build } = require('../../package.json');
32

43
exports.default = async function notarizeMacos(context) {
@@ -7,6 +6,8 @@ exports.default = async function notarizeMacos(context) {
76
return;
87
}
98

9+
const { notarize } = require('@electron/notarize');
10+
1011
if (process.env.CI !== 'true') {
1112
console.warn('Skipping notarizing step. Packaging is not running in CI');
1213
return;
Lines changed: 62 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,81 @@
1-
name: Publish Raspberry Pi (arm64)
1+
name: Publish Raspberry Pi
22

33
on:
4-
workflow_dispatch:
54
push:
65
branches:
76
- main
7+
workflow_dispatch:
88

99
jobs:
10+
# Job 1: arm64のビルド
1011
build-arm64:
1112
runs-on: ubuntu-latest
1213
steps:
13-
- name: Checkout repo
14-
uses: actions/checkout@v3
14+
- name: Checkout git repo
15+
uses: actions/checkout@v4
1516

1617
- name: Set up QEMU
1718
uses: docker/setup-qemu-action@v3
1819
with:
1920
platforms: arm64
2021

21-
- name: Build for arm64
22+
- name: Install build tools
23+
run: sudo apt-get install -y build-essential
24+
25+
- name: Install libfuse2
26+
run: |
27+
sudo apt-get update
28+
sudo apt-get install -y libfuse2
29+
30+
- name: Set up Node.js
31+
uses: actions/setup-node@v3
32+
with:
33+
node-version: 20
34+
35+
- name: Install dependencies
36+
run: npm install
37+
38+
- name: Install serialport from source
39+
run: |
40+
cd release/app
41+
npm install serialport --build-from-source --arch=arm64
42+
43+
- name: Build application
44+
run: npm run build
45+
46+
- name: Build and publish for arm64
47+
env:
48+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49+
run: |
50+
npm exec electron-builder -- --publish always --arm64
51+
52+
# Job 2: armv7lのビルド
53+
build-armv7l:
54+
runs-on: ubuntu-latest
55+
steps:
56+
# 1. ソースコードをチェックアウト
57+
- name: Checkout repository
58+
uses: actions/checkout@v4
59+
60+
# 2. arm32v7 Dockerコンテナ内でビルドと公開の全工程を実行
61+
- name: Build and Publish inside arm32v7 container
2262
env:
2363
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2464
run: |
25-
docker run --rm -t \
26-
--platform linux/arm64 \
27-
-v $PWD:/app \
28-
-w /app \
29-
node:18-bullseye \
30-
bash -c "
31-
npm install &&
32-
npm run postinstall &&
33-
npx electron-rebuild &&
34-
npm run build &&
35-
npx electron-builder --arm64 --publish always
36-
"
65+
docker run --rm \
66+
-v ${{ github.workspace }}:/workspace \
67+
-w /workspace \
68+
-e GH_TOKEN \
69+
arm32v7/node:18 \
70+
/bin/bash -c '
71+
set -e
72+
echo "--- Installing root dependencies ---"
73+
npm install --arch=armv7l
74+
echo "--- Rebuilding native modules ---"
75+
cd release/app && npm install
76+
cd ../..
77+
echo "--- Building application (TS -> JS) ---"
78+
npm run build
79+
echo "--- Packaging and publishing application for armv7l ---"
80+
npm exec electron-builder -- --publish always --armv7l
81+
'

package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@
147147
"css-loader": "^6.8.1",
148148
"css-minimizer-webpack-plugin": "^5.0.0",
149149
"detect-port": "^1.5.1",
150-
"electron": "^25.0.1",
150+
"electron": "25.0.1",
151151
"electron-builder": "^24.2.1",
152152
"electron-devtools-installer": "^3.2.0",
153153
"electronmon": "^2.0.2",

0 commit comments

Comments
 (0)