From fbb76bae55be503957598f342c9b60d6f4bf9a16 Mon Sep 17 00:00:00 2001 From: lucamene04 Date: Thu, 30 Apr 2026 01:44:38 +0200 Subject: [PATCH 1/3] ci: add Windows ARM64 release artifact --- .github/workflows/release.yml | 30 +++++++++++++++++++++++++----- README.md | 9 ++++++--- README_CN.md | 9 ++++++--- 3 files changed, 37 insertions(+), 11 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9801f03..d1cfc74 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,27 +16,45 @@ env: jobs: build-windows: - runs-on: windows-latest + name: build-windows (${{ matrix.name }}) + strategy: + fail-fast: false + matrix: + include: + - name: x64 + runner: windows-latest + python_architecture: x64 + artifact_name: Mouser-Windows + archive_name: Mouser-Windows.zip + - name: ARM64 + runner: windows-11-arm + python_architecture: arm64 + artifact_name: Mouser-Windows-arm64 + archive_name: Mouser-Windows-arm64.zip + runs-on: ${{ matrix.runner }} steps: - uses: actions/checkout@v6 - uses: actions/setup-python@v6 with: python-version: "3.12" + architecture: ${{ matrix.python_architecture }} - name: Install dependencies - run: pip install -r requirements.txt + run: | + python -m pip install --upgrade pip setuptools wheel + python -m pip install -r requirements.txt - name: Build with PyInstaller run: pyinstaller Mouser.spec --noconfirm - name: Create archive - run: Compress-Archive -Path dist\Mouser -DestinationPath Mouser-Windows.zip + run: Compress-Archive -Path dist/Mouser -DestinationPath "${{ matrix.archive_name }}" - uses: actions/upload-artifact@v7 with: - name: Mouser-Windows - path: Mouser-Windows.zip + name: ${{ matrix.artifact_name }} + path: ${{ matrix.archive_name }} build-macos: name: build-macos (${{ matrix.name }}) @@ -236,6 +254,7 @@ jobs: --repo "${{ github.repository }}" \ --clobber \ Mouser-Windows/Mouser-Windows.zip \ + Mouser-Windows-arm64/Mouser-Windows-arm64.zip \ Mouser-macOS/Mouser-macOS.zip \ Mouser-macOS-intel/Mouser-macOS-intel.zip \ Mouser-Linux/Mouser-Linux.zip @@ -245,6 +264,7 @@ jobs: --title "Mouser ${{ github.ref_name }}" \ --generate-notes \ Mouser-Windows/Mouser-Windows.zip \ + Mouser-Windows-arm64/Mouser-Windows-arm64.zip \ Mouser-macOS/Mouser-macOS.zip \ Mouser-macOS-intel/Mouser-macOS-intel.zip \ Mouser-Linux/Mouser-Linux.zip diff --git a/README.md b/README.md index cae7a51..8faecf0 100644 --- a/README.md +++ b/README.md @@ -103,7 +103,10 @@ Action labels adapt by platform. For example, Windows exposes `Win+D` and `Task

- Windows Downloads + Windows x64 Downloads + + + Windows ARM64 Downloads macOS Apple Silicon Downloads @@ -121,7 +124,7 @@ Action labels adapt by platform. For example, Windows exposes `Win+D` and `Task ### Steps 1. Go to the [**latest release page**](https://github.com/TomBadash/Mouser/releases/latest) -2. Download the zip for your platform: **Mouser-Windows.zip**, **Mouser-macOS.zip** (Apple Silicon), **Mouser-macOS-intel.zip** (Intel macOS), or **Mouser-Linux.zip** +2. Download the zip for your platform: **Mouser-Windows.zip** (Windows x64), **Mouser-Windows-arm64.zip** (Windows ARM64), **Mouser-macOS.zip** (Apple Silicon), **Mouser-macOS-intel.zip** (Intel macOS), or **Mouser-Linux.zip** 3. **Extract** the zip to any folder (Desktop, Documents, wherever you like) 4. **Run** the executable: `Mouser.exe` (Windows), `Mouser.app` (macOS), or `./Mouser` (Linux) @@ -306,7 +309,7 @@ pyinstaller Mouser-linux.spec --noconfirm The output is in `dist/Mouser/`. Zip that entire folder and distribute it. -> **Automated releases:** Pushing a `v*` tag triggers the [release workflow](.github/workflows/release.yml), which builds all three platforms in CI and publishes them as GitHub Release assets. +> **Automated releases:** Pushing a `v*` tag triggers the [release workflow](.github/workflows/release.yml), which builds Windows x64, Windows ARM64, macOS, and Linux artifacts in CI and publishes them as GitHub Release assets. --- diff --git a/README_CN.md b/README_CN.md index b58301d..6f4545a 100644 --- a/README_CN.md +++ b/README_CN.md @@ -105,7 +105,10 @@

- Windows Downloads + Windows x64 Downloads + + + Windows ARM64 Downloads macOS Downloads @@ -120,7 +123,7 @@ ### 步骤 1. 进入 [**最新 Release 页面**](https://github.com/TomBadash/Mouser/releases/latest) -2. 下载对应平台的 zip:**Mouser-Windows.zip**、**Mouser-macOS.zip**、**Mouser-Linux.zip** +2. 下载对应平台的 zip:**Mouser-Windows.zip**(Windows x64)、**Mouser-Windows-arm64.zip**(Windows ARM64)、**Mouser-macOS.zip**、**Mouser-Linux.zip** 3. **解压**到任意目录(桌面/文档等均可) 4. **运行**:`Mouser.exe`(Windows)、`Mouser.app`(macOS)、`./Mouser`(Linux) @@ -313,7 +316,7 @@ pyinstaller Mouser-linux.spec --noconfirm 输出目录为 `dist/Mouser/`,将整个目录打包 zip 即可分发。 -> **自动化发布:** 推送 `v*` 标签会触发 [release 工作流](.github/workflows/release.yml),在 CI 中构建三平台产物并发布到 GitHub Releases。 +> **自动化发布:** 推送 `v*` 标签会触发 [release 工作流](.github/workflows/release.yml),在 CI 中构建 Windows x64、Windows ARM64、macOS 与 Linux 产物并发布到 GitHub Releases。 #### 多语言支持(无需额外构建步骤) From 62a86f1b8fe6a654be091f66dedb63a327056bc3 Mon Sep 17 00:00:00 2001 From: lucamene04 Date: Thu, 30 Apr 2026 01:57:43 +0200 Subject: [PATCH 2/3] ci: shorten Windows pip temp path --- .github/workflows/release.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d1cfc74..b4dccae 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -41,7 +41,11 @@ jobs: architecture: ${{ matrix.python_architecture }} - name: Install dependencies + shell: pwsh run: | + New-Item -ItemType Directory -Force C:/pip-tmp | Out-Null + $env:TEMP = "C:/pip-tmp" + $env:TMP = "C:/pip-tmp" python -m pip install --upgrade pip setuptools wheel python -m pip install -r requirements.txt From 01e7e14379390f8d6ccee5f9f6c41d0eb86a00ee Mon Sep 17 00:00:00 2001 From: lucamene04 Date: Thu, 30 Apr 2026 02:09:14 +0200 Subject: [PATCH 3/3] ci: scope ARM64 pip temp workaround --- .github/workflows/release.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b4dccae..42f611e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -40,12 +40,18 @@ jobs: python-version: "3.12" architecture: ${{ matrix.python_architecture }} - - name: Install dependencies + - name: Use short pip temp path for ARM64 source builds + if: matrix.python_architecture == 'arm64' shell: pwsh run: | + # hidapi does not publish Windows ARM64 wheels yet, so pip builds it + # from source. Keep MSVC's generated files under a short/simple path. New-Item -ItemType Directory -Force C:/pip-tmp | Out-Null - $env:TEMP = "C:/pip-tmp" - $env:TMP = "C:/pip-tmp" + "TEMP=C:/pip-tmp" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8 + "TMP=C:/pip-tmp" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8 + + - name: Install dependencies + run: | python -m pip install --upgrade pip setuptools wheel python -m pip install -r requirements.txt