From 1c12d481aff9a163d0bd2bf22a1c938bec210509 Mon Sep 17 00:00:00 2001 From: LuSrackhall <3647637206@qq.com> Date: Mon, 23 Feb 2026 15:30:01 +0800 Subject: [PATCH 1/4] =?UTF-8?q?build(ci):=20=E5=A2=9E=E5=8A=A0=E5=AF=B9=20?= =?UTF-8?q?Windows=20arm64=20=E7=9A=84=E6=9E=84=E5=BB=BA=E6=94=AF=E6=8C=81?= =?UTF-8?q?=EF=BC=8C=E6=B7=BB=E5=8A=A0=E7=9B=B8=E5=85=B3=E5=AE=89=E8=A3=85?= =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E5=92=8C=E5=93=88=E5=B8=8C=E8=AE=A1=E7=AE=97?= =?UTF-8?q?=E6=AD=A5=E9=AA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cd.yml | 73 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 68 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 7b32cf5a..d7681c51 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -10,7 +10,7 @@ jobs: build: strategy: matrix: - os: [windows-latest, ubuntu-latest, macos-15, macos-latest] + os: [windows-latest, windows-11-arm, ubuntu-latest, macos-15, macos-latest] runs-on: ${{ matrix.os }} # 注意:GitHub Secrets 不会“自动变成环境变量”。 # 必须在 workflow 里显式把 secrets.EXTRA_LDFLAGS 映射到 env.EXTRA_LDFLAGS,make 才能继承到。 @@ -24,6 +24,10 @@ jobs: SHA256_X64_SETUP_EXE: ${{ env.SHA256_X64_SETUP_EXE }} MD5_X64_SETUP_EXE: ${{ env.MD5_X64_SETUP_EXE }} # ----------------------------------------------------------------------------------------arm64 + INSTALLER_NAME_ARM64_SETUP_EXE: ${{ env.INSTALLER_NAME_ARM64_SETUP_EXE }} + INSTALLER_NAME_ARM64_ZIP: ${{ env.INSTALLER_NAME_ARM64_ZIP }} + SHA256_ARM64_SETUP_EXE: ${{ env.SHA256_ARM64_SETUP_EXE }} + MD5_ARM64_SETUP_EXE: ${{ env.MD5_ARM64_SETUP_EXE }} # endregion # -------------------Windows end @@ -135,11 +139,39 @@ jobs: # ------------------------------------------------------///////////////////// - # - name: Build Application (Windows arm64) + - name: Build Application (Windows arm64) + if: matrix.os == 'windows-11-arm' + shell: bash + run: | + cd sdk + make win - # - name: Find the generated installer (Windows arm64) + - name: Find the generated installer (Windows arm64) + if: matrix.os == 'windows-11-arm' + working-directory: frontend/dist/electron/Packaged + shell: bash + run: | + INSTALLER_NAME_ARM64_SETUP_EXE=$(basename $(find -name 'KeyTone-*-win*exe')) + if [ "$INSTALLER_NAME_ARM64_SETUP_EXE" != "$(echo $INSTALLER_NAME_ARM64_SETUP_EXE | sed 's/win[^.]*\./win-arm64./')" ]; then + mv -f $INSTALLER_NAME_ARM64_SETUP_EXE $(echo $INSTALLER_NAME_ARM64_SETUP_EXE | sed 's/win[^.]*\./win-arm64./') + INSTALLER_NAME_ARM64_SETUP_EXE=$(echo $INSTALLER_NAME_ARM64_SETUP_EXE | sed 's/win[^.]*\./win-arm64./') + fi + echo "INSTALLER_NAME_ARM64_SETUP_EXE=$INSTALLER_NAME_ARM64_SETUP_EXE" >> $GITHUB_ENV + + INSTALLER_NAME_NO_EXE=$(echo $INSTALLER_NAME_ARM64_SETUP_EXE | sed 's/\.exe$//') + INSTALLER_NAME_ARM64_ZIP=$(echo ${INSTALLER_NAME_NO_EXE}_exe.zip) + echo "INSTALLER_NAME_ARM64_ZIP=$INSTALLER_NAME_ARM64_ZIP" >> $GITHUB_ENV + choco install zip -y + zip -j -9 ${INSTALLER_NAME_ARM64_ZIP} ${INSTALLER_NAME_ARM64_SETUP_EXE} - # - name: Calculate File Hashes (Windows arm64) + - name: Calculate File Hashes (Windows arm64) + if: matrix.os == 'windows-11-arm' + shell: bash + run: | + SHA256_ARM64_SETUP_EXE=$(sha256sum frontend/dist/electron/Packaged/${{ env.INSTALLER_NAME_ARM64_SETUP_EXE }} | awk '{print $1}') + MD5_ARM64_SETUP_EXE=$(md5sum frontend/dist/electron/Packaged/${{ env.INSTALLER_NAME_ARM64_SETUP_EXE }} | awk '{print $1}') + echo "SHA256_ARM64_SETUP_EXE=$SHA256_ARM64_SETUP_EXE" >> $GITHUB_ENV + echo "MD5_ARM64_SETUP_EXE=$MD5_ARM64_SETUP_EXE" >> $GITHUB_ENV # endregion ################################################# Win end ###################################################### @@ -293,6 +325,8 @@ jobs: path: | frontend/dist/electron/Packaged/${{ env.INSTALLER_NAME_X64_SETUP_EXE }} frontend/dist/electron/Packaged/${{ env.INSTALLER_NAME_X64_ZIP }} + frontend/dist/electron/Packaged/${{ env.INSTALLER_NAME_ARM64_SETUP_EXE }} + frontend/dist/electron/Packaged/${{ env.INSTALLER_NAME_ARM64_ZIP }} release: runs-on: ubuntu-latest @@ -329,6 +363,10 @@ jobs: * `${{ needs.build.outputs.SHA256_X64_SETUP_EXE }}` + `${{ needs.build.outputs.INSTALLER_NAME_ARM64_SETUP_EXE }}` is: + + * `${{ needs.build.outputs.SHA256_ARM64_SETUP_EXE }}` + `${{ needs.build.outputs.INSTALLER_NAME_X64_TARGZ }}` is: * `${{ needs.build.outputs.SHA256_X64_TARGZ }}` @@ -355,6 +393,10 @@ jobs: * `${{ needs.build.outputs.MD5_X64_SETUP_EXE }}` + `${{ needs.build.outputs.INSTALLER_NAME_ARM64_SETUP_EXE }}` is: + + * `${{ needs.build.outputs.MD5_ARM64_SETUP_EXE }}` + `${{ needs.build.outputs.INSTALLER_NAME_X64_TARGZ }}` is: * `${{ needs.build.outputs.MD5_X64_TARGZ }}` @@ -402,6 +444,26 @@ jobs: asset_name: ${{ needs.build.outputs.INSTALLER_NAME_X64_ZIP }} asset_content_type: application/zip # asset_content_type 的作用是指定上传文件的 MIME 类型。在这个例子中,它被设置为 application/zip,这是一种通用的压缩文件类型。这样做的目的是告诉 GitHub 这个文件的类型,以便在下载时正确处理它。 + - name: Upload Build Artifact to Release (Windows arm64) (SETUP_EXE) + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.PERSONAL_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: artifacts/${{ needs.build.outputs.INSTALLER_NAME_ARM64_SETUP_EXE }} + asset_name: ${{ needs.build.outputs.INSTALLER_NAME_ARM64_SETUP_EXE }} + asset_content_type: application/octet-stream + + - name: Upload Build Artifact ZIP to Release (Windows arm64) + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.PERSONAL_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: artifacts/${{ needs.build.outputs.INSTALLER_NAME_ARM64_ZIP }} + asset_name: ${{ needs.build.outputs.INSTALLER_NAME_ARM64_ZIP }} + asset_content_type: application/zip + # endregion # -------------------Windows end @@ -469,7 +531,8 @@ jobs: ######################################################################################################### build win # build_windows_x64: # runs-on: windows-latest # 指定虚拟机 - # build_windows_arm64: # TIPS: github actions 的官方运行器暂不提供arm架构下的, win和linux系统环境。 如有需要, 只能自定义运行器。 + # build_windows_arm64: + # runs-on: windows-11-arm # 指定虚拟机 ######################################################################################################### build linux # build_linux_x64: # runs-on: linux-latest # 指定虚拟机 From cc58cf3dbe6729b124e867daa2d33961fbc9dc4d Mon Sep 17 00:00:00 2001 From: LuSrackhall <3647637206@qq.com> Date: Mon, 23 Feb 2026 15:41:59 +0800 Subject: [PATCH 2/4] =?UTF-8?q?build(ci):=20=E6=9B=B4=E6=96=B0=20Node.js?= =?UTF-8?q?=20=E7=89=88=E6=9C=AC=E8=87=B3=2020.x?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cd.yml | 2 +- README.md | 2 +- README.zh-CN.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index d7681c51..aa6ad055 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -77,7 +77,7 @@ jobs: - name: Install Node.js uses: actions/setup-node@v4 # 安装nodejs with: - node-version: "18" # 指定nodejs 版本 + node-version: "20" # 指定nodejs 版本 - name: Install Quasar CLI run: npm install -g @quasar/cli # 安装quasar/cli diff --git a/README.md b/README.md index 77cdd8a2..5c8f0c82 100644 --- a/README.md +++ b/README.md @@ -119,7 +119,7 @@ You can obtain **KeyTone** through the following methods: The project requires the following development environment: * Go 1.24.5 -* Node.js 18.x +* Node.js 20.x * Quasar CLI ### Setup Steps on Windows diff --git a/README.zh-CN.md b/README.zh-CN.md index 98cffe0f..2858d84d 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -121,7 +121,7 @@ KeyTone 赋予你自由创作的舞台,让每一次按键敲击都成为独一 本项目开发环境依赖如下: * Go 1.24.5 -* Node.js 18.x +* Node.js 20.x * Quasar CLI ### Windows 下环境搭建步骤 From 82419295c6713957a9fe422319f0e38a25812631 Mon Sep 17 00:00:00 2001 From: LuSrackhall <3647637206@qq.com> Date: Mon, 23 Feb 2026 16:05:44 +0800 Subject: [PATCH 3/4] =?UTF-8?q?build(ci):=20=E4=B8=BA=20Windows=20arm64=20?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20zig=E4=BD=9C=E4=B8=BAcgo=20=E5=B7=A5?= =?UTF-8?q?=E5=85=B7=E9=93=BE=E7=9A=84=E4=B8=80=E7=8E=AF,=20=E5=9B=A0?= =?UTF-8?q?=E4=B8=BAWin-ARM=20=E6=9E=84=E5=BB=BA=E7=BC=BA=E5=B0=91?= =?UTF-8?q?=E5=8F=AF=E7=94=A8=E7=9A=84=20ARM64=20cgo=20=E7=BC=96=E8=AF=91?= =?UTF-8?q?=E5=99=A8=EF=BC=8C=E5=AF=BC=E8=87=B4=E6=B1=87=E7=BC=96=20gcc=5F?= =?UTF-8?q?arm64.S=20=E8=A2=AB=E9=94=99=E8=AF=AF=E6=B1=87=E7=BC=96?= =?UTF-8?q?=E5=99=A8=E5=A4=84=E7=90=86=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Run cd sdk go install github.com/josephspurrier/goversioninfo/cmd/goversioninfo@v1.4.1 go: downloading github.com/josephspurrier/goversioninfo v1.4.1 go: downloading github.com/akavel/rsrc v0.10.2 goversioninfo -platform-specific=true -icon="../frontend/src-electron/icons/icon.ico" -manifest="resource\goversioninfo.exe.manifest" go build -ldflags '-s -w ***' -o "../frontend/dist/key_tone_sdk/KeyTone.exe" go: downloading github.com/gin-gonic/gin v1.10.0 go: downloading github.com/joho/godotenv v1.5.1 go: downloading github.com/fsnotify/fsnotify v1.8.0 go: downloading github.com/LuSrackhall/viper v1.20.1-custom go: downloading github.com/robotn/gohook v0.41.0 go: downloading github.com/gin-contrib/cors v1.7.2 go: downloading github.com/gopxl/beep/v2 v2.1.1 go: downloading golang.org/x/sys v0.29.0 go: downloading golang.org/x/crypto v0.32.0 go: downloading github.com/gin-contrib/sse v0.1.0 go: downloading github.com/mattn/go-isatty v0.0.20 go: downloading golang.org/x/net v0.33.0 go: downloading github.com/vcaesar/keycode v0.10.1 go: downloading github.com/pkg/errors v0.9.1 go: downloading github.com/hajimehoshi/go-mp3 v0.3.4 go: downloading github.com/ebitengine/oto/v3 v3.3.2 go: downloading github.com/jfreymuth/oggvorbis v1.0.5 go: downloading github.com/go-playground/validator/v10 v10.20.0 go: downloading github.com/pelletier/go-toml/v2 v2.2.4 go: downloading github.com/ugorji/go/codec v1.2.12 go: downloading google.golang.org/protobuf v1.36.1 go: downloading gopkg.in/yaml.v3 v3.0.1 go: downloading github.com/go-viper/mapstructure/v2 v2.3.0 go: downloading github.com/sagikazarmark/locafero v0.9.0 go: downloading github.com/spf13/afero v1.14.0 go: downloading github.com/spf13/cast v1.9.2 go: downloading github.com/spf13/pflag v1.0.6 go: downloading github.com/jfreymuth/vorbis v1.0.2 go: downloading github.com/gabriel-vasile/mimetype v1.4.3 go: downloading github.com/go-playground/universal-translator v0.18.1 go: downloading github.com/leodido/go-urn v1.4.0 go: downloading golang.org/x/text v0.23.0 go: downloading github.com/sourcegraph/conc v0.3.0 go: downloading github.com/subosito/gotenv v1.6.0 go: downloading github.com/go-playground/locales v0.14.1 runtime/cgo gcc_arm64.S: Assembler messages: gcc_arm64.S:30: Error: no such instruction: stp x29,x30,[sp,' gcc_arm64.S:34: Error: operand size mismatch for mov' gcc_arm64.S:36: Error: no such instruction: stp x19,x20,[sp,' gcc_arm64.S:39: Error: no such instruction: stp x21,x22,[sp,' gcc_arm64.S:42: Error: no such instruction: stp x23,x24,[sp,' gcc_arm64.S:45: Error: no such instruction: stp x25,x26,[sp,' gcc_arm64.S:48: Error: no such instruction: stp x27,x28,[sp,' gcc_arm64.S:52: Error: operand size mismatch for mov' gcc_arm64.S:53: Error: operand size mismatch for mov' gcc_arm64.S:54: Error: operand size mismatch for mov' gcc_arm64.S:56: Error: no such instruction: blr x20' gcc_arm64.S:57: Error: no such instruction: blr x19' gcc_arm64.S:59: Error: no such instruction: ldp x27,x28,[sp,' gcc_arm64.S:62: Error: no such instruction: ldp x25,x26,[sp,' gcc_arm64.S:65: Error: no such instruction: ldp x23,x24,[sp,' gcc_arm64.S:68: Error: no such instruction: ldp x21,x22,[sp,' gcc_arm64.S:71: Error: no such instruction: ldp x19,x20,[sp,' gcc_arm64.S:74: Error: no such instruction: ldp x29,x30,[sp],' make: *** [makefile:53: win] Error 1 Error: Process completed with exit code 2. --- .github/workflows/cd.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index aa6ad055..c99a34c6 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -139,11 +139,22 @@ jobs: # ------------------------------------------------------///////////////////// + - name: Install cgo toolchain (Windows arm64) + if: matrix.os == 'windows-11-arm' + shell: bash + run: | + choco install zig -y + - name: Build Application (Windows arm64) if: matrix.os == 'windows-11-arm' shell: bash run: | cd sdk + export GOOS=windows + export GOARCH=arm64 + export CGO_ENABLED=1 + export CC="zig cc -target aarch64-windows-gnu" + export CXX="zig c++ -target aarch64-windows-gnu" make win - name: Find the generated installer (Windows arm64) From d5724536dad81fefb4d690e304e2f317e467a718 Mon Sep 17 00:00:00 2001 From: LuSrackhall <3647637206@qq.com> Date: Mon, 23 Feb 2026 21:19:18 +0800 Subject: [PATCH 4/4] =?UTF-8?q?build(ci):=20=E7=A7=BB=E9=99=A4=20Windows?= =?UTF-8?q?=20=E6=9E=84=E5=BB=BA=E6=97=B6=20=E5=AF=B9=E5=AE=89=E8=A3=85?= =?UTF-8?q?=E5=8C=85=E6=9E=B6=E6=9E=84=E9=99=90=E5=88=B6,=20=E8=AE=A9?= =?UTF-8?q?=E5=85=B6=E5=9C=A8=E6=9E=84=E5=BB=BA=E6=97=B6=E8=83=BD=E5=A4=9F?= =?UTF-8?q?=E8=B7=9F=E9=9A=8F=E5=AE=9E=E9=99=85=E7=9A=84=E8=BF=90=E8=A1=8C?= =?UTF-8?q?=E5=99=A8=E7=B3=BB=E7=BB=9F=E6=9E=B6=E6=9E=84=E8=BF=9B=E8=A1=8C?= =?UTF-8?q?=E8=B7=9F=E9=9A=8F=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 现在 Win-ARM 构建应输出对应的 KeyTone-xxx-win-arm64.appx --- frontend/quasar.config.js | 1 - 1 file changed, 1 deletion(-) diff --git a/frontend/quasar.config.js b/frontend/quasar.config.js index 10b7c80d..f4e72822 100644 --- a/frontend/quasar.config.js +++ b/frontend/quasar.config.js @@ -268,7 +268,6 @@ module.exports = configure(function (/* ctx */) { 'nsis', // 普通安装包 { target: 'appx', - arch: ['x64'], }, ], },