Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
1c692ce
refactor!: 重构项目结构为标准 Go CLI 结构
YewFence Apr 1, 2026
c259e8b
ci(release): 使用 GoReleaser 重构构建与发布流程
YewFence Apr 1, 2026
4a04bd6
docs: 增加 vitepress 文档站,简化 README
YewFence Apr 1, 2026
cc0e5a5
fix(orchestrator): 统一备份流程收尾,确保中止场景也上传日志并发送通知
YewFence Apr 1, 2026
457b40a
test: 补充单测并增加 CI 流程
YewFence Apr 1, 2026
2c9868e
fix(ci): 修复错误的 goreleaser 版本号与 pnpm/setup 的错误参数
YewFence Apr 1, 2026
0bd644a
fix(orchestrator): 在所有错误中传递 finalErr 以在通知中显示明确信息
YewFence Apr 1, 2026
af4edcb
fix(ci): 将 docs CI 修正为使用 pnpm
YewFence Apr 1, 2026
821b45a
docs: 同步配置加载与日志说明并修正文档示例
YewFence Apr 1, 2026
45c89ef
fix(ci): 对齐 GoReleaser v2 并增强流水线一致性校验
YewFence Apr 1, 2026
1d4392b
ci: 更新所有 action 的大版本至最新
YewFence Apr 1, 2026
5ab098d
ci: 使用 pinact 锁定所有 action 版本
YewFence Apr 1, 2026
313c33f
ci: 增加 pinact 检查 lefthook 以避免未 pin 的 action 提交
YewFence Apr 1, 2026
f83a81f
fix(pre-commit): 为 pinact token 设置失败增加降级告警
YewFence Apr 1, 2026
da7a4c7
docs: 更新 lefthook / pinact / ghtkn 开发依赖要求文档
YewFence Apr 1, 2026
142bdea
ci: 更新 audit github action
YewFence Apr 1, 2026
2f123d3
chore: 更新 Go 版本至 1.25.8 以修复标准库 audit 问题
YewFence Apr 1, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .env.goreleaser.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# GoReleaser 环境变量配置
# 正式发布时需要配置以下变量

# GitHub Token(用于发布 Release 和推送 Docker 镜像到 GHCR)
GITHUB_TOKEN=

# Homebrew Tap 仓库配置
HOMEBREW_TAP_NAME=
HOMEBREW_TAP_OWNER=
TAP_GITHUB_TOKEN=
35 changes: 24 additions & 11 deletions .github/workflows/build-artifact.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,16 @@ on:
branches:
- main
paths:
- 'src/**'
- "**.go"
- "go.mod"
- "go.sum"
- ".goreleaser.yaml"
workflow_dispatch:
inputs:
ref:
description: '要构建的分支或标签'
description: "要构建的分支或标签"
required: true
default: 'main'
default: "main"

permissions:
contents: read
Expand All @@ -20,18 +23,28 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ inputs.ref || github.ref }}
- name: Run make
run: |
make
fetch-depth: 0

- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: "1.25.8"

- name: Run tests
run: go test -v ./...

- name: Build with GoReleaser (snapshot)
uses: goreleaser/goreleaser-action@ec59f474b9834571250b370d4735c50f8e2d1e29 # v7.0.0
with:
distribution: goreleaser
version: "~> v2"
args: build --snapshot --clean

- name: Upload artifact
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: yewresin-${{ github.sha }}
path: |
yewresin.sh
.env.example
path: dist/*
retention-days: 7
77 changes: 77 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: CI

on:
pull_request:
branches: [main]
workflow_dispatch:

permissions:
contents: read

jobs:
go:
name: Go
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: "1.25.8"

- name: Check go.mod tidy
run: |
go mod tidy
git diff --exit-code go.mod go.sum

- name: Vet
run: go vet ./...

- name: Test
run: go test -v ./...

- name: Build
run: go build ./...

audit:
name: Audit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: "1.25.8"

- name: Verify dependencies
run: go mod verify

- id: govulncheck
uses: golang/govulncheck-action@b625fbe08f3bccbe446d94fbf87fcc875a4f50ee # v1.0.4
with:
go-version-input: "1.25.8"
repo-checkout: false

docs:
name: Docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0
with:
version: 10

- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: 22
cache: pnpm
cache-dependency-path: docs/pnpm-lock.yaml

- name: Install dependencies
working-directory: docs
run: pnpm install --frozen-lockfile

- name: Build
working-directory: docs
run: pnpm build
64 changes: 64 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Deploy Docs

on:
push:
branches: [main]
paths:
- "docs/**"
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: pages
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Setup pnpm
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0
with:
version: 10

- name: Setup Node
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: 22
cache: pnpm
cache-dependency-path: docs/pnpm-lock.yaml

- name: Setup Pages
uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d # v6.0.0

- name: Install dependencies
working-directory: docs
run: pnpm install --frozen-lockfile

- name: Build with VitePress
working-directory: docs
run: pnpm build

- name: Upload artifact
uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v4.0.0
with:
path: docs/.vitepress/dist

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build
runs-on: ubuntu-latest
name: Deploy
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5.0.0
61 changes: 0 additions & 61 deletions .github/workflows/go-build-artifact.yml

This file was deleted.

38 changes: 0 additions & 38 deletions .github/workflows/go-prod-release.yml

This file was deleted.

26 changes: 0 additions & 26 deletions .github/workflows/prod-release.yml

This file was deleted.

32 changes: 32 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Release

on:
push:
tags:
- "v*"

permissions:
contents: write

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0

- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: "1.25.8"

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@ec59f474b9834571250b370d4735c50f8e2d1e29 # v7.0.0
with:
version: "~> v2"
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAP_GITHUB_TOKEN: ${{ secrets.TAP_GITHUB_TOKEN }}
HOMEBREW_TAP_OWNER: ${{ vars.HOMEBREW_TAP_OWNER }}
HOMEBREW_TAP_NAME: ${{ vars.HOMEBREW_TAP_NAME }}
11 changes: 9 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
.env
yewresin.sh
.env.goreleaser
dist/
*.exe
yewresin

.claude/
docs/node_modules/
docs/.vitepress/dist/
docs/.vitepress/cache/

.claude/
Loading
Loading