diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a66f6a4..d6245f3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -301,3 +301,58 @@ jobs: fi done echo "✓ Gitea publishing step completed!" + + update-brew-tap: + name: 🍺 Update Homebrew Tap + needs: [build-and-publish-github, publish-gitea] + if: ${{ !cancelled() && needs.build-and-publish-github.result == 'success' }} + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - name: Checkout Homebrew Tap + uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 + with: + repository: yunyingk/homebrew-tap + token: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} + path: tap + + - name: Download checksums from GitHub Release + env: + GH_TOKEN: ${{ github.token }} + run: | + TAG_NAME="${{ github.event.inputs.tag || github.ref_name }}" + gh release download "${TAG_NAME}" \ + --repo "${GITHUB_REPOSITORY}" \ + --pattern 'checksums.txt' \ + --dir . \ + --clobber + + - name: Update Formula + run: | + RAW_TAG="${{ github.event.inputs.tag || github.ref_name }}" + VERSION="${RAW_TAG#v}" + ARM64_SHA=$(grep 'seal-use-darwin-arm64.tar.gz' checksums.txt | awk '{print $1}') + + if [ -z "$ARM64_SHA" ]; then + echo "::error::Could not find sha256 for seal-use-darwin-arm64.tar.gz" + exit 1 + fi + + echo "Updating Formula to version ${VERSION} with sha256 ${ARM64_SHA}" + + FORMULA_FILE="tap/Formula/seal-use.rb" + sed -i -E "s/version \"[^\"]+\"/version \"${VERSION}\"/" "$FORMULA_FILE" + sed -i -E "s/sha256 \"[^\"]+\"/sha256 \"${ARM64_SHA}\"/" "$FORMULA_FILE" + + cd tap + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + if git diff --quiet; then + echo "No changes to Formula, skipping commit." + else + git add Formula/seal-use.rb + git commit -m "chore(release): bump seal-use to ${VERSION}" + git push origin main + echo "✓ Homebrew Tap formula updated successfully!" + fi + diff --git a/skills/seal-use/SKILL.md b/skills/seal-use/SKILL.md index 6ec0f2c..2fcafef 100644 --- a/skills/seal-use/SKILL.md +++ b/skills/seal-use/SKILL.md @@ -30,14 +30,16 @@ seal-use corps list 如果 CLI 或 Skill 尚未安装或落后于发布版本,通过以下命令一键安装或升级: -```bash -# 方式 1:CLI 自更新(已安装时推荐) +# 方式 1:Homebrew(macOS 官方包管理,推荐) +brew install yunyingk/tap/seal-use + +# 方式 2:CLI 自更新(已安装时推荐) seal-use update -# 方式 2:国内高速一键安装与自愈(Gitea 镜像源,免代理、秒级完成) +# 方式 3:国内高速一键安装与自愈(Gitea 镜像源,免代理、秒级完成) curl -fsSL https://git.ying-qing.cn/gitea/seal-use/raw/branch/main/scripts/install.sh | bash -# 方式 3:Global / GitHub Direct +# 方式 4:Global / GitHub Direct curl -fsSL https://raw.githubusercontent.com/yunyingk/seal-use/main/scripts/install.sh | bash ```