forked from dfvips/um-react-electron
-
Notifications
You must be signed in to change notification settings - Fork 6
135 lines (114 loc) · 3.37 KB
/
build-electron.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
name: Build Electron Application
on:
workflow_dispatch:
inputs:
release:
type: boolean
description: Release artifacts
required: false
default: false
push:
branches:
- "main"
paths:
- "um-react"
- ".github/workflows/build-electron.yml"
permissions:
contents: write
jobs:
build-linux-windows:
name: Build Linux & Windows
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.version }}
steps:
- name: Checkout
uses: actions/[email protected]
- name: Install system dependencies
run: |
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install npm wine32
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: latest
- name: Install npm dependencies
run: |
git submodule update --init --recursive
cd um-react
pnpm install --frozen-lockfile
cd ..
npm install --frozen-lockfile
- name: Update version
id: version
run: |
um_ver=$(npm info ./um-react version)
npm version $um_ver --allow-same-version --no-commit-hooks --no-git-tag-version
echo $um_ver
echo version=$um_ver >> "$GITHUB_OUTPUT"
- name: Build
run: |
npm run build:win
npm run build:linux
- name: Upload Windows build
uses: actions/[email protected]
with:
name: Windows build 7z
path: release/**/*.7z
- name: Upload Linux build
uses: actions/[email protected]
with:
name: Linux build AppImage
path: release/**/*.AppImage
build-macos:
name: Build macOS
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/[email protected]
- name: Install system dependencies
run: brew install node
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: latest
- name: Install npm dependencies
run: |
git submodule update --init --recursive
cd um-react
pnpm install --frozen-lockfile
cd ..
npm install --frozen-lockfile
- name: Update version
run: |
um_ver=$(npm info ./um-react version)
npm version $um_ver --allow-same-version --no-commit-hooks --no-git-tag-version
echo $um_ver
- name: Build
run: |
npm run build:mac
- name: Upload macOS build
uses: actions/[email protected]
with:
name: macOS build dmg
path: release/**/*.dmg
upload-release:
name: Upload Release
runs-on: ubuntu-latest
if: ${{ inputs.release || github.event_name == 'push' }}
needs: [build-linux-windows, build-macos]
steps:
- name: Download release files
uses: actions/download-artifact@v4
with:
merge-multiple: true
- name: Upload release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ needs.build-linux-windows.outputs.version }}/*
tag: ${{ needs.build-linux-windows.outputs.version }}
body: Release ${{ needs.build-linux-windows.outputs.version }}
overwrite: true
file_glob: true