From 86c318d86b40f8c0c857ab9adb9f1792c9284339 Mon Sep 17 00:00:00 2001 From: MystiPanda Date: Thu, 7 Dec 2023 16:38:39 +0800 Subject: [PATCH] feat: Add AppImage for x86 linux --- .github/build-for-linux/build.sh | 2 +- .github/workflows/release.yml | 2 +- scripts/updater.mjs | 19 +++++++++++++++---- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/.github/build-for-linux/build.sh b/.github/build-for-linux/build.sh index dc1844c..46c8b59 100644 --- a/.github/build-for-linux/build.sh +++ b/.github/build-for-linux/build.sh @@ -2,7 +2,7 @@ pnpm install pnpm check $INPUT_TARGET sed -i "s/#openssl/openssl={version=\"0.10\",features=[\"vendored\"]}/g" src-tauri/Cargo.toml -if [ "$INPUT_TARGET" = "x86_64-unknown-linux-gnu" ]; then +if [ "$INPUT_TARGET" = "x86_64-unknown-linux-gnu" ] || [ "$INPUT_TARGET" = "i686-unknown-linux-gnu" ]; then pnpm build --target $INPUT_TARGET else pnpm build --target $INPUT_TARGET -b deb diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0821278..a049b12 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -117,7 +117,7 @@ jobs: sudo apt-get install jq echo "VERSION=$(cat package.json | jq '.version' | tr -d '"')" >> $GITHUB_ENV - name: Upload Release - if: startsWith(matrix.target, 'x86_64') + if: startsWith(matrix.target, 'x86_64') || startsWith(matrix.target, 'i686') uses: softprops/action-gh-release@v1 with: tag_name: v${{env.VERSION}} diff --git a/scripts/updater.mjs b/scripts/updater.mjs index da1892a..9f375ab 100644 --- a/scripts/updater.mjs +++ b/scripts/updater.mjs @@ -45,6 +45,7 @@ async function resolveUpdater() { "darwin-intel": { signature: "", url: "" }, "darwin-x86_64": { signature: "", url: "" }, "linux-x86_64": { signature: "", url: "" }, + "linux-i686": { signature: "", url: "" }, "linux-aarch64": { signature: "", url: "" }, "windows-x86_64": { signature: "", url: "" }, "windows-i686": { signature: "", url: "" }, @@ -100,16 +101,16 @@ async function resolveUpdater() { updateData.platforms["darwin-aarch64"].signature = sig; } - // linux url - if (name.endsWith(".AppImage.tar.gz")) { + // linux x64 url + if (name.endsWith("amd64.AppImage.tar.gz")) { updateData.platforms.linux.url = browser_download_url; updateData.platforms["linux-x86_64"].url = browser_download_url; // 暂时使用x64版本的url和sig,使得可以检查更新,但aarch64版本还不支持构建appimage updateData.platforms["linux-aarch64"].url = browser_download_url; // updateData.platforms["linux-armv7"].url = browser_download_url; } - // linux signature - if (name.endsWith(".AppImage.tar.gz.sig")) { + // linux x64 signature + if (name.endsWith("amd64.AppImage.tar.gz.sig")) { const sig = await getSignature(browser_download_url); updateData.platforms.linux.signature = sig; updateData.platforms["linux-x86_64"].signature = sig; @@ -117,6 +118,16 @@ async function resolveUpdater() { updateData.platforms["linux-aarch64"].signature = sig; // updateData.platforms["linux-armv7"].signature = sig; } + + // linux x86 url + if (name.endsWith("i386.AppImage.tar.gz")) { + updateData.platforms["linux-i686"].url = browser_download_url; + } + // linux x86 signature + if (name.endsWith("i386.AppImage.tar.gz.sig")) { + const sig = await getSignature(browser_download_url); + updateData.platforms["linux-i686"].signature = sig; + } }); await Promise.allSettled(promises);