From 7649b789e12362ad95559f83dce93605559ad4af Mon Sep 17 00:00:00 2001 From: RememBerBer Date: Sat, 6 Jun 2026 00:02:06 +0800 Subject: [PATCH] =?UTF-8?q?GitHub=20Actions=20CI=20=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E6=89=93=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-installers.yml | 17 ++++++++++++++++- .gitignore | 1 + readme.md | 3 ++- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-installers.yml b/.github/workflows/build-installers.yml index b597d18c..62728d83 100644 --- a/.github/workflows/build-installers.yml +++ b/.github/workflows/build-installers.yml @@ -22,21 +22,25 @@ jobs: target: mac-x64 profile: mac-intel artifact_dir: target/mac-intel + release_label: mac-intel - name: macOS Apple Silicon runner: macos-14 target: mac-arm64 profile: mac-apple-silicon artifact_dir: target/mac-apple-silicon + release_label: mac-apple-silicon - name: Windows x64 runner: windows-latest target: windows-x64 profile: windows-x64 artifact_dir: target/windows-x64 + release_label: windows-x64 - name: Linux x64 runner: ubuntu-latest target: linux-x64 profile: linux-x64 artifact_dir: target/linux-x64 + release_label: linux-x64 steps: - name: Checkout @@ -68,12 +72,19 @@ jobs: - name: Build installer run: mvn --batch-mode --no-transfer-progress clean package -P${{ matrix.profile }} -Dmaven.test.skip=true + - name: Stage release assets + run: >- + python scripts/collect_release_assets.py + --source-dir ${{ matrix.artifact_dir }} + --output-dir dist/${{ matrix.profile }} + --target-label ${{ matrix.release_label }} + - name: Upload artifacts uses: actions/upload-artifact@v4 with: name: ${{ matrix.profile }} path: | - ${{ matrix.artifact_dir }} + dist/${{ matrix.profile }} if-no-files-found: error retention-days: 14 @@ -101,5 +112,9 @@ jobs: release-assets/**/*.zip release-assets/**/*.tar.gz release-assets/**/*.deb + release-assets/**/*.rpm + release-assets/**/*.msi + release-assets/**/*.exe + release-assets/**/*.jar diff --git a/.gitignore b/.gitignore index 768d21df..d2f0e4c5 100644 --- a/.gitignore +++ b/.gitignore @@ -27,6 +27,7 @@ target/ /nbdist/ /.nb-gradle/ build/ +dist/ ### VS Code ### .vscode/ diff --git a/readme.md b/readme.md index 67c0de78..01bccb0b 100644 --- a/readme.md +++ b/readme.md @@ -382,5 +382,6 @@ mvn clean package -Plinux-x64 -Dmaven.test.skip=true - `windows-latest`:`windows-x64` - `ubuntu-latest`:`linux-x64` - 使用 `actions/cache` 缓存 `downloads/jdks/` 和 `jdks/` -- 每个 job 会上传各自平台的安装包产物 +- 每个 job 会把产物重命名为统一格式后再上传,例如:`MooTool-1.7.0-mac-intel.dmg`、`MooTool-1.7.0-windows-x64.zip` +- Actions Summary 会列出“原始文件名 -> Release 文件名”的对照表,方便核对每个平台实际产物 - 推送 `v*` 标签时,会自动创建或更新对应 GitHub Release,并上传构建出的安装包附件