Repository navigation
feat(writer): 自动维护根 .gitignore 并支持 generated/portable/off #19
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | |
| on: | |
| push: | |
| tags: | |
| - "v*.*.*" | |
| workflow_dispatch: | |
| inputs: | |
| tag: | |
| description: "要发布的 tag (如 v0.1.0)" | |
| required: true | |
| permissions: | |
| contents: write | |
| concurrency: | |
| group: release-${{ github.ref }} | |
| cancel-in-progress: false | |
| jobs: | |
| goreleaser: | |
| name: Goreleaser | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: go.mod | |
| cache: true | |
| - name: 检出指定 tag (workflow_dispatch) | |
| if: github.event_name == 'workflow_dispatch' | |
| run: git checkout "${{ inputs.tag }}" | |
| - name: 安装 git-cliff | |
| uses: taiki-e/install-action@v2 | |
| with: | |
| tool: git-cliff | |
| - name: 生成 changelog (latest tag only) | |
| run: | | |
| git-cliff --config cliff.toml --latest --strip all -o CHANGELOG_LATEST.md | |
| echo "--- generated release notes ---" | |
| cat CHANGELOG_LATEST.md | |
| - name: 运行 goreleaser | |
| uses: goreleaser/goreleaser-action@v6 | |
| with: | |
| distribution: goreleaser | |
| version: "~> v2" | |
| args: release --clean --release-notes=CHANGELOG_LATEST.md | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: 上传 dist 工件 (调试用) | |
| if: failure() | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: dist-debug | |
| path: dist/ | |
| retention-days: 7 |