Skip to content

Commit

Permalink
feat: loongarch package
Browse files Browse the repository at this point in the history
  • Loading branch information
msojocs committed May 9, 2024
1 parent 4e780d0 commit 0a8e06e
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 3 deletions.
17 changes: 15 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ jobs:
strategy:
matrix:
node-version: [16.x]
ARCH: ['x64']
ARCH: ['x64', 'loong64', 'loongarch64']
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
Expand All @@ -173,8 +173,17 @@ jobs:
path: tmp/src

- name: Prepare
env:
BUILD_ARCH: ${{ matrix.ARCH }}
run: |
sudo npm install asar -g
if [ "$BUILD_ARCH" == "loong64" ];then
# 新世界
npm config set registry https://registry.loongnix.cn:5873/
elif [ "$BUILD_ARCH" == "loongarch64" ];then
# 旧世界
npm config set registry https://registry.loongnix.cn:4873/
fi
npm install
echo "$UID, $GID"
Expand All @@ -201,7 +210,11 @@ jobs:
mkdir -p tmp/build
tools/build-prepare.sh
asar e app/app.asar app/app
npm run pkg-linux
if [ "$BUILD_ARCH" == loong* ];then
npm run pkg-loongarch
else
npm run pkg-linux
fi
rm -rf tmp/build/*-unpacked
# tools/build-appimage.sh ${{ steps.tag.outputs.tag }} ${{ matrix.ARCH }}
Expand Down
57 changes: 57 additions & 0 deletions conf/loongarch-build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"buildVersion": "1",
"directories": {
"output": "tmp/build",
"app": "app/app"
},
"asar": true,
"files": [
"**/*",
{
"from": "node_modules",
"to": "node_modules"
}
],
"extraResources": [
"extensions",
"app/app-update.yml"
],
"electronVersion": "21.3.3",
"appId": "com.bilibili.app",
"mac": {
"target": [
"dmg",
"zip"
],
"icon": "res/icons/bilibili.icns"
},
"win": {
"target": [
"nsis"
],
"icon": "res/icons/bilibili.ico"
},
"nsis": {
"oneClick": false,
"installerIcon": "res/icons/bilibili.ico",
"uninstallerIcon": "res/icons/bilibili.ico",
"installerHeaderIcon": "res/icons/bilibili.ico",
"allowToChangeInstallationDirectory": true
},
"linux": {
"target": [
"AppImage",
"deb",
"rpm"
],
"maintainer": "msojocs <[email protected]> (https://www.jysafe.cn)",
"icon": "res/icons",
"synopsis": "BiliBili client for Linux.",
"description": "BiliBili client for Linux with roaming.",
"category": "AudioVideo"
},
"electronDownload": {
"mirror": "https://github.com/msojocs/electron-loongarch/",
"customDir": "v22.3.27"
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"pkg-win": "electron-builder --win --x64 --arm64",
"pkg-mac": "electron-builder --mac --x64",
"pkg-linux": "electron-builder --linux --x64 --arm64",
"pkg-loongarch": "electron-installer-debian --config config.json",
"pkg-loongarch": "electron-builder --linux --loongarch64 -c conf/loongarch-build.json",
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
Expand Down

0 comments on commit 0a8e06e

Please sign in to comment.