Skip to content

Commit 1a78160

Browse files
authored
chore(release): unify SDLC flow and publish CLI artifacts (#215)
## Type - [ ] `feat` — New feature - [ ] `fix` — Bug fix - [ ] `refactor` — Code restructure (no behavior change) - [ ] `docs` — Documentation only - [ ] `test` — Test coverage - [x] `chore` — Build, CI, tooling - [ ] `perf` — Performance improvement ## Summary Unifies SDLC workflow policy around worktree-first development, removes unnecessary Codecov token usage for public repository uploads, and aligns contributor workflow docs with enforced CI safety practices. ## Changes - add explicit worktree/branch safety rules and skill usage expectations in AGENTS.md - update CONTRIBUTING pull request workflow to require worktree-based feature branches from updated main - remove CODECOV_TOKEN dependency in ci workflow Codecov upload step ## Breaking Changes None ## Validation ```bash make fmt && make lint && make vuln && make test && make test-coverage make cli-smoke-build && make cli-smoke-scaffold ``` ## Checklist - [x] Code follows project style (`make fmt` passes) - [x] Linter passes (`make lint`) - [x] Vulnerability scan passes (`make vuln`) - [x] Tests pass (`make test`) - [x] Coverage tests pass (`make test-coverage`) - [x] CLI smoke checks pass (`make cli-smoke-build && make cli-smoke-scaffold`) - [ ] Tests added/updated for new functionality - [x] Documentation updated (if applicable) - [x] Commit messages follow Conventional Commits ## Resolves N/A ## Notes - Existing PR #215 updated with this template-aligned body. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Documentation** * Added comprehensive release process guide covering CI workflow, semantic versioning, and multi-platform artifact publishing. * Updated contribution guidelines with enhanced development workflow, including new linting and vulnerability scanning steps. * **Chores** * Configured multi-platform CLI release automation with support for macOS, Linux, and Windows. * Updated GitHub workflows with concurrency controls and enhanced security scanning. * Updated repository contact links in issue templates. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 426a0c9 commit 1a78160

10 files changed

Lines changed: 148 additions & 18 deletions

File tree

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
blank_issues_enabled: false
22
contact_links:
33
- name: Questions & Discussions
4-
url: https://github.com/aryeko/modkit/discussions
4+
url: https://github.com/go-modkit/modkit/discussions
55
about: Ask questions and discuss ideas (don't open an issue)
66
- name: Security Vulnerabilities
7-
url: https://github.com/aryeko/modkit/security/policy
7+
url: https://github.com/go-modkit/modkit/security/policy
88
about: Report security issues privately

.github/pull_request_template.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,19 @@
2626

2727
<!-- Commands run and their results -->
2828
```bash
29-
make fmt && make lint && make test
29+
make fmt && make lint && make vuln && make test && make test-coverage
30+
make cli-smoke-build && make cli-smoke-scaffold
3031
```
3132

3233
## Checklist
3334

3435
<!-- All boxes should be checked before requesting review -->
3536
- [ ] Code follows project style (`make fmt` passes)
3637
- [ ] Linter passes (`make lint`)
38+
- [ ] Vulnerability scan passes (`make vuln`)
3739
- [ ] Tests pass (`make test`)
40+
- [ ] Coverage tests pass (`make test-coverage`)
41+
- [ ] CLI smoke checks pass (`make cli-smoke-build && make cli-smoke-scaffold`)
3842
- [ ] Tests added/updated for new functionality
3943
- [ ] Documentation updated (if applicable)
4044
- [ ] Commit messages follow [Conventional Commits](https://www.conventionalcommits.org/)

.github/workflows/ci.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ on:
66
- main
77
pull_request:
88

9+
permissions:
10+
contents: read
11+
12+
concurrency:
13+
group: ci-${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: true
15+
916
jobs:
1017
pr-title:
1118
name: Validate PR Title
@@ -66,7 +73,6 @@ jobs:
6673
- name: Upload coverage to Codecov
6774
uses: codecov/codecov-action@v5
6875
with:
69-
token: ${{ secrets.CODECOV_TOKEN }}
7076
files: .coverage/coverage.out
7177
fail_ci_if_error: false
7278

.github/workflows/release.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ on:
55
branches:
66
- main
77

8+
concurrency:
9+
group: release-${{ github.ref }}
10+
cancel-in-progress: false
11+
812
permissions:
913
contents: write
1014

@@ -24,6 +28,28 @@ jobs:
2428
allow-initial-development-versions: true
2529
changelog-generator-opt: "emojis=true"
2630

31+
- name: Set up Go
32+
if: steps.semrel.outputs.version != ''
33+
uses: actions/setup-go@v6
34+
with:
35+
go-version: "1.25.7"
36+
cache-dependency-path: |
37+
tools/tools.go
38+
go.mod
39+
40+
- name: Refresh tags
41+
if: steps.semrel.outputs.version != ''
42+
run: git fetch --force --tags
43+
44+
- name: Publish CLI release artifacts
45+
if: steps.semrel.outputs.version != ''
46+
uses: goreleaser/goreleaser-action@v6
47+
with:
48+
version: "~> v2"
49+
args: release --clean
50+
env:
51+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
52+
2753
- name: Release info
2854
if: steps.semrel.outputs.version != ''
2955
run: |

.goreleaser.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
version: 2
2+
3+
project_name: modkit
4+
5+
builds:
6+
- id: modkit
7+
main: ./cmd/modkit
8+
binary: modkit
9+
env:
10+
- CGO_ENABLED=0
11+
goos:
12+
- darwin
13+
- linux
14+
- windows
15+
goarch:
16+
- amd64
17+
- arm64
18+
ignore:
19+
- goos: windows
20+
goarch: arm64
21+
22+
archives:
23+
- id: modkit
24+
builds:
25+
- modkit
26+
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
27+
format_overrides:
28+
- goos: windows
29+
format: zip
30+
31+
checksum:
32+
name_template: checksums.txt
33+
34+
changelog:
35+
disable: true
36+
37+
release:
38+
draft: false
39+
prerelease: auto

AGENTS.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,19 @@ High-signal packages by density:
7373
- If `make vuln` or `make test-coverage` is not run or fails, leave corresponding checklist items unchecked (or mark N/A with explicit reason).
7474
- After any new commit on the PR branch, rerun affected checks and re-reconcile the checklist.
7575

76+
## WORKTREE AND BRANCH SAFETY
77+
- `main` is integration-only. Never commit directly on `main`/`master`.
78+
- Start each task from updated `origin/main`: `git fetch origin && git switch main && git pull --ff-only origin main`.
79+
- Create a dedicated branch in a dedicated worktree for each task: `git worktree add .worktrees/<task> -b <type>/<task> main`.
80+
- Do all edits, tests, and commits only inside that linked worktree branch.
81+
- Never push directly to `main`; all changes land through PR merge.
82+
- If a commit lands on `main` by mistake: create a rescue branch from the pre-revert state, cherry-pick or move intended commits there, then `git revert` on `main`.
83+
84+
## SKILL USAGE EXPECTATION
85+
- Before acting, evaluate available skills and load matching skills for the task.
86+
- Use `superpowers/using-git-worktrees` when starting implementation work.
87+
- Use `superpowers/verification-before-completion` before declaring completion.
88+
7689
## COMMANDS
7790
```bash
7891
make fmt

CONTRIBUTING.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -108,16 +108,11 @@ make cli-smoke-scaffold
108108
### Install Development Tools
109109

110110
```bash
111-
# goimports (for make fmt)
112-
go install golang.org/x/tools/cmd/goimports@latest
113-
114-
# golangci-lint (for make lint)
115-
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
116-
117-
# govulncheck (for make vuln)
118-
go install golang.org/x/vuln/cmd/govulncheck@latest
111+
make tools
119112
```
120113

114+
`make tools` installs tool versions pinned by the repository.
115+
121116
## Contribution Guidelines
122117

123118
### Before You Start
@@ -129,9 +124,13 @@ go install golang.org/x/vuln/cmd/govulncheck@latest
129124
### Pull Request Process
130125

131126
1. Fork the repository
132-
2. Create a feature branch (`git checkout -b feat/my-feature`)
127+
2. Update `main` and create a feature worktree branch:
128+
- `git fetch origin && git switch main && git pull --ff-only origin main`
129+
- `git worktree add .worktrees/my-feature -b feat/my-feature main`
130+
- Work from `.worktrees/my-feature` (do not commit on `main`)
133131
3. Make your changes with tests
134-
4. Run `make fmt && make lint && make test`
132+
4. Run `make fmt && make lint && make vuln && make test && make test-coverage`
133+
- Also run CLI gate: `make cli-smoke-build && make cli-smoke-scaffold`
135134
5. Commit with a conventional prefix (`feat:`, `fix:`, `docs:`, `chore:`)
136135
6. Open a pull request with a clear description
137136

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ See [Architecture Guide](docs/architecture.md) for details.
224224
- [API Reference](docs/reference/api.md) — Types and functions
225225
- [Architecture](docs/architecture.md) — How modkit works under the hood
226226
- [FAQ](docs/faq.md) — Common questions
227+
- [Release Process](docs/guides/release-process.md) — CI and versioned CLI release flow
227228

228229
**Examples:**
229230
- [hello-simple](examples/hello-simple/) — Minimal example, no Docker

docs/guides/release-process.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Release Process
2+
3+
This repository uses a unified SDLC flow for CI and releases:
4+
5+
1. Pull request checks run on each PR:
6+
- PR title semantic validation
7+
- lint + vulnerability scan
8+
- coverage tests
9+
- CLI smoke scaffolding checks
10+
2. Merges to `main` trigger the release workflow.
11+
3. `go-semantic-release` determines whether a new semantic version should be released from Conventional Commits.
12+
4. If a version is released, GoReleaser builds and publishes CLI artifacts to the GitHub Release:
13+
- `darwin/amd64`
14+
- `darwin/arm64`
15+
- `linux/amd64`
16+
- `linux/arm64`
17+
- `windows/amd64`
18+
5. Release assets include archives and `checksums.txt`.
19+
20+
## Quality Gates
21+
22+
Before creating or updating a PR, run:
23+
24+
```bash
25+
make fmt && make lint && make vuln && make test && make test-coverage
26+
make cli-smoke-build && make cli-smoke-scaffold
27+
```
28+
29+
Branch protection should require these workflow checks on pull requests:
30+
31+
- `Validate PR Title`
32+
- `Quality (Lint & Vuln)`
33+
- `test`
34+
- `CLI Smoke Test`
35+
- `Analyze` (CodeQL)
36+
37+
## Versioning Rules
38+
39+
- `fix:` -> patch
40+
- `feat:` -> minor
41+
- `feat!:` / `BREAKING CHANGE:` -> major (or minor during initial development when configured)
42+
- docs/chore/test/ci-only commits do not release by default

docs/specs/design-release-versioning-sdlc-cli.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ Current release flow creates semantic versions and release notes, but it does no
5656

5757
## 6. Required CI Changes
5858

59-
## 6.1. Add CLI Smoke-Test Job in `ci.yml`
59+
## 6.1. Maintain CLI Smoke-Test Job in `ci.yml`
6060

61-
Add a new job `cli-smoke` that runs on pull requests and pushes.
61+
`cli-smoke` is already present in `ci.yml` and must remain a required check on pull requests and pushes.
6262

6363
Validation sequence:
6464

@@ -180,7 +180,7 @@ This initiative is complete when all are true:
180180

181181
### Phase 1: CI Guardrails
182182

183-
- Add `cli-smoke` job to `ci.yml`.
183+
- Confirm `cli-smoke` job remains enforced in `ci.yml`.
184184
- Validate against current `main`.
185185

186186
### Phase 2: Release Artifacts
@@ -207,7 +207,7 @@ This initiative is complete when all are true:
207207

208208
The follow-up PR (after `feat/cli-tooling` merge) should include:
209209

210-
- [ ] `.github/workflows/ci.yml` updated with `cli-smoke` job.
210+
- [ ] `cli-smoke` job in `.github/workflows/ci.yml` is preserved and remains required.
211211
- [ ] `.github/workflows/release.yml` updated for CLI artifact publishing.
212212
- [ ] `.goreleaser.yml` added and validated.
213213
- [ ] README install section updated.

0 commit comments

Comments
 (0)