Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 62a702fb89 | |||
| 2614f23856 |
@@ -3,6 +3,12 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
Format: [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
Format: [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
||||||
|
|
||||||
|
## [1.3.0] - 2026-07-07
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- **`release.env` dotenv artifact** — on every real release (not `--dry-run`) a `release.env` file is written to the repository root containing `NEXT_VERSION=<tag>`; the file is never committed, allowing GitLab CI to expose it as a dotenv artifact and pass the version to downstream jobs (deploy, notify, etc.)
|
||||||
|
|
||||||
## [1.2.0] - 2026-07-07
|
## [1.2.0] - 2026-07-07
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# releaser
|
# releaser
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
A CI-friendly release automation tool for GitFlow workflows using Conventional Commits.
|
A CI-friendly release automation tool for GitFlow workflows using Conventional Commits.
|
||||||
|
|
||||||
|
|||||||
@@ -70,6 +70,7 @@
|
|||||||
- [x] ~~Colored, structured CLI output~~ — ✓ shipped v1.2.0 (`·` / `✓` / `!` symbols, `▸` section headers in verbose, TTY-aware ANSI colors)
|
- [x] ~~Colored, structured CLI output~~ — ✓ shipped v1.2.0 (`·` / `✓` / `!` symbols, `▸` section headers in verbose, TTY-aware ANSI colors)
|
||||||
- [x] ~~Name and version header on every run~~ — ✓ shipped v1.2.0
|
- [x] ~~Name and version header on every run~~ — ✓ shipped v1.2.0
|
||||||
- [x] ~~Default tag prefix changed to empty~~ — ✓ shipped v1.2.0 (bare `1.2.3` tags by default; opt in to `v` prefix via config)
|
- [x] ~~Default tag prefix changed to empty~~ — ✓ shipped v1.2.0 (bare `1.2.3` tags by default; opt in to `v` prefix via config)
|
||||||
|
- [x] ~~`release.env` dotenv artifact~~ — ✓ shipped v1.3.0 (`NEXT_VERSION=<tag>` written on every release for GitLab CI downstream jobs)
|
||||||
- [ ] Documentation site
|
- [ ] Documentation site
|
||||||
|
|
||||||
## Future / backlog
|
## Future / backlog
|
||||||
|
|||||||
@@ -387,6 +387,13 @@ func run(o options) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// --- release.env (GitLab CI dotenv artifact) ---
|
||||||
|
releaseEnvPath := filepath.Join(absRepo, "release.env")
|
||||||
|
if err := os.WriteFile(releaseEnvPath, []byte("NEXT_VERSION="+nextTag+"\n"), 0644); err != nil {
|
||||||
|
return fmt.Errorf("write release.env: %w", err)
|
||||||
|
}
|
||||||
|
logDone("release.env: NEXT_VERSION=%s", nextTag)
|
||||||
|
|
||||||
// --- pom.xml + CHANGELOG.md (skipped with --tag-only) ---
|
// --- pom.xml + CHANGELOG.md (skipped with --tag-only) ---
|
||||||
if !o.tagOnly {
|
if !o.tagOnly {
|
||||||
var filesToCommit []string
|
var filesToCommit []string
|
||||||
|
|||||||
@@ -658,6 +658,47 @@ func TestRunChangelogFile(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestRunReleaseEnv(t *testing.T) {
|
||||||
|
_, dir := setupRepo(t)
|
||||||
|
addFile(t, dir, "x.go", "// fix")
|
||||||
|
repo, _ := gogit.PlainOpen(dir)
|
||||||
|
w, _ := repo.Worktree()
|
||||||
|
w.Add("x.go")
|
||||||
|
w.Commit("fix: something", &gogit.CommitOptions{Author: testSig()})
|
||||||
|
|
||||||
|
err := execCmd(t, "--no-push", "--branch", "release/1.2", "--repo", dir)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("unexpected error: %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
data, err := os.ReadFile(filepath.Join(dir, "release.env"))
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal("expected release.env to be created")
|
||||||
|
}
|
||||||
|
content := strings.TrimSpace(string(data))
|
||||||
|
if content != "NEXT_VERSION=1.2.0" {
|
||||||
|
t.Errorf("release.env content = %q, want %q", content, "NEXT_VERSION=1.2.0")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestRunReleaseEnvDryRun(t *testing.T) {
|
||||||
|
_, dir := setupRepo(t)
|
||||||
|
addFile(t, dir, "x.go", "// fix")
|
||||||
|
repo, _ := gogit.PlainOpen(dir)
|
||||||
|
w, _ := repo.Worktree()
|
||||||
|
w.Add("x.go")
|
||||||
|
w.Commit("fix: something", &gogit.CommitOptions{Author: testSig()})
|
||||||
|
|
||||||
|
err := execCmd(t, "--dry-run", "--branch", "release/1.2", "--repo", dir)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("unexpected error: %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if _, err := os.Stat(filepath.Join(dir, "release.env")); err == nil {
|
||||||
|
t.Error("release.env must not be created in --dry-run mode")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func TestRunVerbose(t *testing.T) {
|
func TestRunVerbose(t *testing.T) {
|
||||||
_, dir := setupRepo(t)
|
_, dir := setupRepo(t)
|
||||||
addFile(t, dir, "x.go", "// feat")
|
addFile(t, dir, "x.go", "// feat")
|
||||||
|
|||||||
Reference in New Issue
Block a user