-
Notifications
You must be signed in to change notification settings - Fork 39
82 lines (69 loc) · 2.05 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: Build App
permissions:
contents: write
on:
push:
tags:
- v*
jobs:
release:
name: build and release electron app
runs-on: ${{ matrix.os }}
if: startsWith(github.ref, 'refs/tags/')
strategy:
fail-fast: false
matrix:
os: [windows-latest, macos-latest]
steps:
- name: Check out git repository
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 16
- name: Install Dependencies
run: |
npm i -g pnpm
pnpm install
- name: Build Electron App for windows
if: matrix.os == 'windows-latest'
run: pnpm run build:win
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
- name: Build Electron App for macos
if: matrix.os == 'macos-latest'
run: |
pnpm run build:mac
pnpm run build:mac-arm
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
# - name: Build Electron App for linux
# if: matrix.os == 'ubuntu-latest'
# run: |
# pnpm run build:linux
# env:
# GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
- name: Cleanup Artifacts for Windows
if: matrix.os == 'windows-latest'
run: |
npx del-cli "dist/*" "!dist/*.exe" "!dist/*.zip" "!dist/*.yml"
- name: Cleanup Artifacts for MacOS
if: matrix.os == 'macos-latest'
run: |
npx del-cli "dist/*" "!dist/(*.dmg|*.zip|latest*.yml)"
# - name: Cleanup Artifacts for Linux
# if: matrix.os == 'ubuntu-latest'
# run: |
# npx del "dist/*" "!dist/(*.AppImage.*|latest*.yml|*.appimage.*)"
- name: upload artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}
path: dist
- name: release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: 'dist/**'
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}