fix: 参考 new-pet 项目修正 Actions 配置
Publish Mini Program Dev Version / publish (push) Waiting to run
Build and Deploy Server / build (push) Waiting to run

- 使用 hk 运行器(空闲状态)
- 添加详细注释说明
- 参考 new-pet 的成熟配置
- 确保只在指定目录变更时触发
This commit is contained in:
gouki
2026-08-06 22:59:56 +00:00
parent 09d8a39946
commit c19854ce77
2 changed files with 14 additions and 6 deletions
+5
View File
@@ -10,10 +10,12 @@ on:
jobs:
publish:
# 使用 hk 运行器(空闲状态)
runs-on: hk
steps:
- uses: https://gitea.neatcn.com/gouki/action-checkout@v4
with:
# Need recent commit subjects for the WeChat upload remark.
fetch-depth: 20
- name: Verify Node runtime
run: node --version
@@ -47,6 +49,7 @@ jobs:
env:
MINIAPP_APPID: ${{ vars.MINIAPP_APPID }}
MINIAPP_ROBOT: ${{ vars.MINIAPP_ROBOT }}
# Prefer the version resolved before build so UI label matches WeChat upload.
MINIAPP_BUILD_NUMBER: ${{ gitea.run_number }}
MINIAPP_VERSION_OVERRIDE: ${{ vars.MINIAPP_VERSION_OVERRIDE }}
WECHAT_CI_PRIVATE_KEY_PATH: ${{ runner.temp }}/wechat-ci.key
@@ -59,11 +62,13 @@ jobs:
test -n "$MINIAPP_BUILD_NUMBER"
test -s ci-artifacts/resolved-version.txt
RESOLVED_VERSION="$(tr -d '\n' < ci-artifacts/resolved-version.txt)"
# Force upload to the same version that was baked into the JS bundle.
export MINIAPP_VERSION_OVERRIDE="$RESOLVED_VERSION"
mkdir -p ci-artifacts
node -e 'const c=require("./project.config.json"); if(c.appid!==process.env.MINIAPP_APPID){console.error("MINIAPP_APPID mismatch with project.config.json", process.env.MINIAPP_APPID, c.appid); process.exit(1)}'
node -e 'const {resolveVersion}=require("./ci/resolve-version.cjs"); console.log("Resolved Mini Program version:", resolveVersion(process.cwd()))'
node -e 'const {resolveUploadDesc}=require("./ci/resolve-upload-desc.cjs"); console.log("Resolved upload remark:", resolveUploadDesc({repoRoot:require("path").resolve(".."), versionLabel:process.env.MINIAPP_VERSION_LABEL}))'
# Normalize PEM newlines that may be flattened when stored in Secrets.
python3 - <<'PY'
from pathlib import Path
import os