Skip to content

Commit 488da25

Browse files
authored
Move actions to workflow folder (#2463)
* add actions * move workflows
1 parent 3a784be commit 488da25

File tree

2 files changed

+143
-0
lines changed

2 files changed

+143
-0
lines changed

.github/workflows/ci.yaml

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: electron-ci
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+
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
19+
- name: Set up Node.js 20.17.0
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: '20.17.0'
23+
24+
- name: Install lerna 6.1.0
25+
run: npm install -g [email protected]
26+
27+
- name: Bootstrap
28+
run: npm run bootstrap
29+
30+
- name: Lint
31+
run: npm run lint
32+
33+
- name: Build
34+
run: npm run build
35+
env:
36+
NODE_OPTIONS: --openssl-legacy-provider
37+
38+
- name: Check for vulnerabilities
39+
run: npm audit
40+
continue-on-error: true
41+

.github/workflows/pack.yaml

+102
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: Pack Electron App
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
build:
8+
runs-on: ${{ matrix.os }}
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
os: [ubuntu-latest, macos-latest, windows-latest]
13+
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v4
17+
18+
- name: Set up Node.js 20.17.0
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version: '20.17.0'
22+
23+
- name: Install lerna 6.1.0
24+
run: npm install -g [email protected]
25+
26+
- name: Bootstrap
27+
run: npm run bootstrap
28+
29+
- name: Lint
30+
run: npm run lint
31+
32+
- name: Build
33+
run: npm run build
34+
env:
35+
NODE_OPTIONS: --openssl-legacy-provider
36+
37+
- name: Check for vulnerabilities
38+
run: npm audit
39+
continue-on-error: true
40+
41+
- name: Get Electron
42+
working-directory: packages/app/main
43+
run: node scripts/downloadAndExtractElectron.js
44+
45+
- name: Pack Linux
46+
if: matrix.os == 'ubuntu-latest'
47+
working-directory: packages/app/main
48+
run: npm run pack -- --linux --x64
49+
env:
50+
NODE_ENV: production
51+
52+
- name: Dist Linux
53+
if: matrix.os == 'ubuntu-latest'
54+
working-directory: packages/app/main
55+
run: npm run dist -- --linux --prepackaged ./dist/linux-unpacked
56+
env:
57+
NODE_ENV: production
58+
59+
- name: Upload Linux
60+
if: matrix.os == 'ubuntu-latest'
61+
uses: actions/upload-artifact@v4
62+
with:
63+
name: BF-Emulator-Linux.AppImage
64+
path: packages/app/main/dist/*.AppImage
65+
66+
- name: Pack Windows
67+
if: matrix.os == 'windows-latest'
68+
working-directory: packages/app/main
69+
run: npm run pack -- --win --x64
70+
env:
71+
NODE_ENV: production
72+
73+
- name: Dist Windows
74+
if: matrix.os == 'windows-latest'
75+
working-directory: packages/app/main
76+
run: npm run dist -- --win --prepackaged ./dist/win-unpacked
77+
78+
- name: Upload Windows
79+
if: matrix.os == 'windows-latest'
80+
uses: actions/upload-artifact@v4
81+
with:
82+
name: BF-Emulator-Windows.setup.exe
83+
path: packages/app/main/dist/*.exe
84+
85+
- name: Pack Mac
86+
if: matrix.os == 'macos-latest'
87+
working-directory: packages/app/main
88+
run: npm run pack -- --mac --x64
89+
env:
90+
NODE_ENV: production
91+
92+
- name: Dist Mac
93+
if: matrix.os == 'macos-latest'
94+
working-directory: packages/app/main
95+
run: npm run dist -- --mac --prepackaged ./dist/mac
96+
97+
- name: Upload Mac
98+
if: matrix.os == 'macos-latest'
99+
uses: actions/upload-artifact@v4
100+
with:
101+
name: BF-Emulator-mac.dmg
102+
path: packages/app/main/dist/*.dmg

0 commit comments

Comments
 (0)