-
Notifications
You must be signed in to change notification settings - Fork 6
160 lines (136 loc) · 4.46 KB
/
build.yml
File metadata and controls
160 lines (136 loc) · 4.46 KB
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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
name: Build TWLauncher for Windows and Linux
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build-windows:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Cache Electron and builder cache
uses: actions/cache@v3
with:
path: |
~/.cache/electron
~/.cache/electron-builder
node_modules/.cache
key: ${{ runner.os }}-electron-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-electron-
- name: Install dependencies
run: npm ci --prefer-offline
- name: Set author info
run: |
npm pkg set author.name="${{ github.actor }}"
npm pkg set author.email="${{ github.event.pusher.email || 'noreply@github.com' }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build/release Electron app (Portable)
run: npm run build:win-portable
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build/release Electron app (Installer)
run: npm run build:win-installer
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: List dist directory
run: dir dist
shell: cmd
- name: Upload portable artifact
uses: actions/upload-artifact@v4
with:
name: twlauncher-windows-portable
path: dist/TWLauncher-x64.exe
if-no-files-found: warn
compression-level: 6
overwrite: false
include-hidden-files: false
- name: Upload installer artifact
uses: actions/upload-artifact@v4
with:
name: twlauncher-windows-installer
path: dist/TWLauncher-Setup.exe
if-no-files-found: warn
compression-level: 6
overwrite: false
include-hidden-files: false
build-linux:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Cache Electron and builder cache
uses: actions/cache@v3
with:
path: |
~/.cache/electron
~/.cache/electron-builder
node_modules/.cache
key: ${{ runner.os }}-electron-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-electron-
- name: Install dependencies
run: npm ci --prefer-offline
- name: Install Linux build dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
libfuse2 squashfs-tools
wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage -O /tmp/appimagetool
chmod +x /tmp/appimagetool
sudo mv /tmp/appimagetool /usr/local/bin/appimagetool
env:
DEBIAN_FRONTEND: noninteractive
- name: Set author info
run: |
npm pkg set author.name="${{ github.actor }}"
npm pkg set author.email="${{ github.event.pusher.email || 'noreply@github.com' }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build/release Electron app (AppImage)
run: npm run build:linux-appimage
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build/release Electron app (Installer)
run: npm run build:linux-installer
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: List dist directory
run: ls -la dist
- name: Upload AppImage artifact
uses: actions/upload-artifact@v4
with:
name: twlauncher-linux-appimage
path: dist/*.AppImage
if-no-files-found: error
compression-level: 6
overwrite: false
include-hidden-files: false
- name: Upload installer artifact
uses: actions/upload-artifact@v4
with:
name: twlauncher-linux-installer
path: dist/*.deb
if-no-files-found: warn
compression-level: 6
overwrite: false
include-hidden-files: false