Skip to content

Commit 3070912

Browse files
committed
chore(build): support linux
1 parent 671c10f commit 3070912

File tree

2 files changed

+60
-3
lines changed

2 files changed

+60
-3
lines changed

.github/workflows/build-and-release-desktop-app.yml

Lines changed: 55 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ jobs:
119119

120120
- name: List dist-app contents
121121
run: ls -la dist-app
122-
122+
123123
- name: Update Release (macOS)
124124
uses: softprops/action-gh-release@v2
125125
with:
@@ -129,3 +129,57 @@ jobs:
129129
dist-app/latest*.yml
130130
env:
131131
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
132+
133+
build-linux:
134+
runs-on: ubuntu-latest
135+
steps:
136+
- name: Checkout code
137+
uses: actions/checkout@v3
138+
139+
- name: Setup Node.js
140+
uses: actions/setup-node@v3
141+
with:
142+
node-version: "20.16.0"
143+
144+
- name: Install pnpm
145+
uses: pnpm/action-setup@v2
146+
with:
147+
version: 8
148+
149+
- name: Download and extract libsimple
150+
run: |
151+
curl -L https://github.com/wangfenjin/simple/releases/latest/download/libsimple-linux-ubuntu-latest.zip -o libsimple.zip
152+
unzip libsimple.zip
153+
libsimple_dir=$(ls -d libsimple* | head -n 1)
154+
if [ -d "$libsimple_dir" ]; then
155+
mv "$libsimple_dir" dist-simple
156+
else
157+
mkdir dist-simple
158+
mv libsimple* dist-simple/
159+
fi
160+
ls -R dist-simple
161+
shell: bash
162+
163+
- name: Install dependencies
164+
run: pnpm install
165+
166+
- name: Build application
167+
env:
168+
NODE_OPTIONS: "--max_old_space_size=4096"
169+
run: pnpm run build:desktop
170+
171+
- name: Build AppImage
172+
run: pnpm run pkg:desktop
173+
174+
- name: List dist-app contents
175+
run: ls -la dist-app
176+
177+
- name: Update Release (Linux)
178+
uses: softprops/action-gh-release@v2
179+
with:
180+
files: |
181+
dist-app/*.AppImage
182+
dist-app/*.zip
183+
dist-app/latest*.yml
184+
env:
185+
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,10 @@
8484
"notarize": false
8585
},
8686
"linux": {
87-
"target": "AppImage"
87+
"target": [
88+
"AppImage",
89+
"zip"
90+
]
8891
}
8992
},
9093
"dependencies": {
@@ -297,4 +300,4 @@
297300
]
298301
}
299302
}
300-
}
303+
}

0 commit comments

Comments
 (0)