Skip to content

Commit 23eac08

Browse files
committed
r0b08x [chore] 5/4/2024, 5:33:33 PM
1 parent aeac3b1 commit 23eac08

File tree

3 files changed

+73
-2
lines changed

3 files changed

+73
-2
lines changed

.github/workflows/test.yml

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Build and Publish Electron Snap
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v2
17+
18+
- name: Extract version from package.json
19+
run: echo "PACKAGE_VERSION=$(jq -r '.version' package.json)" >> $GITHUB_ENV
20+
21+
- name: Set up QEMU
22+
uses: docker/setup-qemu-action@v1
23+
with:
24+
platforms: linux/arm64
25+
26+
- name: Set up Docker Buildx
27+
uses: docker/setup-buildx-action@v1
28+
29+
- name: Build and push Docker image
30+
uses: docker/build-push-action@v2
31+
with:
32+
context: .
33+
file: Dockerfile
34+
load: true
35+
platforms: linux/arm64
36+
tags: yourusername/electronapp:latest
37+
38+
- name: Setup Node.js (LTS version)
39+
uses: actions/setup-node@v3
40+
with:
41+
node-version: 'lts/*' # This will automatically use the latest LTS version
42+
43+
- name: Install Dependencies
44+
run: npm install
45+
46+
- name: Build and Publish the Snap
47+
run: npm run publish-electron-arm64
48+
49+
- name: Login to Snapcraft
50+
run: echo "${{ secrets.SNAPCRAFT_LOGIN_FILE }}" | base64 --decode --ignore-garbage > snapcraft.login
51+
52+
- name: Publish the snap
53+
run: |
54+
snapcraft login --with snapcraft.login
55+
snapcraft upload dist/*.snap --release=stable

Dockerfile

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Use an official Node base image with ARM64 support at LTS version
2+
FROM arm64v8/node:lts
3+
4+
# Install snapcraft and other dependencies
5+
RUN apt-get update && apt-get install -y snapcraft
6+
7+
# Set the working directory
8+
WORKDIR /app
9+
10+
# Copy your project files into the Docker image
11+
COPY . /app
12+
13+
# Install project dependencies
14+
RUN npm install

package.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "p3x-onenote",
3-
"version": "2024.4.177",
3+
"version": "2024.4.176",
44
"description": "📚 P3X OneNote Linux",
55
"main": "src/electron/app.js",
66
"corifeus": {
@@ -37,6 +37,7 @@
3737
"publish-electron-deb": "rm -rf dist && electron-builder -p onTagOrDraft --linux --armv7l --arm64 --linux deb --x64",
3838
"publish-electron-test": "rm -rf dist && electron-builder -p onTagOrDraft --linux --linux AppImage deb --x64",
3939
"publish-electron-snap": "rm -rf dist && electron-builder --linux snap -p never --armv7l --x64",
40+
"publish-electron-arm64": "rm -rf dist && electron-builder --linux snap -p never --arm64",
4041
"publish-windows": "rimraf dist && electron-builder -p always --windows",
4142
"publish-electron-yml": "node ./node_modules/corifeus-builder/src/utils/appimage/post-build.js",
4243
"publish-macos": "electron-builder --mac --publish never"
@@ -67,7 +68,8 @@
6768
"corifeus-utils": "2024.4.123",
6869
"electron-store": "8.2.0",
6970
"electron-updater": "6.1.8",
70-
"semver": "7.6.0"
71+
"semver": "7.6.0",
72+
"electron": "^30.0.2"
7173
},
7274
"devDependencies": {
7375
"corifeus-builder": "2024.4.140",

0 commit comments

Comments
 (0)