- 新增 auto-dev-release.yml: push feat/dws-devapp → 跑 build+test → 通过则自增 dev 版本号、打 tag、自包含发 release(不靠 tag 触发 release.yml, 绕开 GITHUB_TOKEN 不触发的限制); 不含 npm 步骤天然绿; concurrency 串行防撞号 - release.yml: npm publish 加 owner 条件, fork 跳过避免红叉 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
74 lines
2.1 KiB
YAML
74 lines
2.1 KiB
YAML
name: Release
|
||
|
||
on:
|
||
push:
|
||
tags:
|
||
- "v*"
|
||
workflow_dispatch:
|
||
|
||
permissions:
|
||
contents: write
|
||
|
||
jobs:
|
||
release:
|
||
runs-on: ubuntu-latest
|
||
timeout-minutes: 30
|
||
|
||
steps:
|
||
- name: Check out repository
|
||
uses: actions/checkout@v4
|
||
with:
|
||
fetch-depth: 0
|
||
|
||
- name: Set up Go
|
||
uses: actions/setup-go@v5
|
||
with:
|
||
go-version-file: go.mod
|
||
|
||
- name: Install archive tooling
|
||
run: sudo apt-get update && sudo apt-get install -y zip unzip
|
||
|
||
- name: Install rcodesign (ad-hoc sign darwin binaries from Linux)
|
||
run: |
|
||
set -eu
|
||
RCS_VERSION="0.27.0"
|
||
curl -fsSL -o /tmp/rcodesign.tar.gz \
|
||
"https://github.com/indygreg/apple-platform-rs/releases/download/apple-codesign%2F${RCS_VERSION}/apple-codesign-${RCS_VERSION}-x86_64-unknown-linux-musl.tar.gz"
|
||
mkdir -p /tmp/rcodesign
|
||
tar -xzf /tmp/rcodesign.tar.gz -C /tmp/rcodesign --strip-components=1
|
||
sudo install -m 0755 /tmp/rcodesign/rcodesign /usr/local/bin/rcodesign
|
||
rcodesign --version
|
||
|
||
- name: Run GoReleaser
|
||
uses: goreleaser/goreleaser-action@v6
|
||
with:
|
||
version: "~> v2"
|
||
args: release --clean
|
||
env:
|
||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||
|
||
- name: Post-release packaging
|
||
run: ./scripts/release/post-goreleaser.sh
|
||
env:
|
||
DWS_PACKAGE_VERSION: ${{ github.ref_name }}
|
||
|
||
- name: Upload dws-skills.zip to release
|
||
env:
|
||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||
run: |
|
||
gh release upload "${{ github.ref_name }}" dist/dws-skills.zip --clobber
|
||
|
||
- name: Setup Node.js
|
||
uses: actions/setup-node@v4
|
||
with:
|
||
node-version: "20"
|
||
registry-url: "https://registry.npmjs.org"
|
||
|
||
- name: Publish to npm
|
||
# 只有官方仓库发 npm;fork(dev 预览)没有 NPM_TOKEN,跳过以免红叉
|
||
if: ${{ github.repository_owner == 'DingTalk-Real-AI' }}
|
||
working-directory: dist/npm/dingtalk-workspace-cli
|
||
run: npm publish --access public
|
||
env:
|
||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|