Skip to content

Commit

Permalink
chore(build): support linux
Browse files Browse the repository at this point in the history
  • Loading branch information
mayneyao committed Oct 14, 2024
1 parent 671c10f commit 3070912
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 3 deletions.
56 changes: 55 additions & 1 deletion .github/workflows/build-and-release-desktop-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ jobs:

- name: List dist-app contents
run: ls -la dist-app

- name: Update Release (macOS)
uses: softprops/action-gh-release@v2
with:
Expand All @@ -129,3 +129,57 @@ jobs:
dist-app/latest*.yml
env:
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}

build-linux:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "20.16.0"

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8

- name: Download and extract libsimple
run: |
curl -L https://github.com/wangfenjin/simple/releases/latest/download/libsimple-linux-ubuntu-latest.zip -o libsimple.zip
unzip libsimple.zip
libsimple_dir=$(ls -d libsimple* | head -n 1)
if [ -d "$libsimple_dir" ]; then
mv "$libsimple_dir" dist-simple
else
mkdir dist-simple
mv libsimple* dist-simple/
fi
ls -R dist-simple
shell: bash

- name: Install dependencies
run: pnpm install

- name: Build application
env:
NODE_OPTIONS: "--max_old_space_size=4096"
run: pnpm run build:desktop

- name: Build AppImage
run: pnpm run pkg:desktop

- name: List dist-app contents
run: ls -la dist-app

- name: Update Release (Linux)
uses: softprops/action-gh-release@v2
with:
files: |
dist-app/*.AppImage
dist-app/*.zip
dist-app/latest*.yml
env:
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,10 @@
"notarize": false
},
"linux": {
"target": "AppImage"
"target": [
"AppImage",
"zip"
]
}
},
"dependencies": {
Expand Down Expand Up @@ -297,4 +300,4 @@
]
}
}
}
}

0 comments on commit 3070912

Please sign in to comment.