diff --git a/.gitignore b/.gitignore index 39b2573..410f62f 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,9 @@ # --- build output --- /bin/ -/dist/ +# at any depth: a test that forgets a temp DistDir writes ./dist beside its +# package, and that output was committed once (apps/volt/release/dist) +dist/ /tmp/ # `go build` inside a module dir drops a binary named after that dir apps/cli/cli diff --git a/apps/volt/release/dist/checksums.txt b/apps/volt/release/dist/checksums.txt deleted file mode 100644 index d799150..0000000 --- a/apps/volt/release/dist/checksums.txt +++ /dev/null @@ -1 +0,0 @@ -4fde73b1d209aec66c12cd2294a06986435fb0f951561cf20314525bcc8c0f57 notes_v1.0.0_darwin_arm64.tar.gz diff --git a/apps/volt/release/dist/notes_v1.0.0_darwin_arm64.tar.gz b/apps/volt/release/dist/notes_v1.0.0_darwin_arm64.tar.gz deleted file mode 100644 index 6955b78..0000000 Binary files a/apps/volt/release/dist/notes_v1.0.0_darwin_arm64.tar.gz and /dev/null differ diff --git a/apps/volt/release/release_test.go b/apps/volt/release/release_test.go index 340eb9f..6fa2e4c 100644 --- a/apps/volt/release/release_test.go +++ b/apps/volt/release/release_test.go @@ -720,8 +720,13 @@ func TestFromTagKeepsBrewChannel(t *testing.T) { mustGit(t, root, "add", ".") mustGit(t, root, "commit", "-q", "-m", "brew cfg") pushed := "" + // An explicit temp DistDir, for both runs: without one the build writes + // ./dist inside this package's source directory, and that output was + // once committed. Every `go test` then rewrote tracked files, left the + // tree dirty, and made the next `volt release` refuse. + dist := filepath.Join(t.TempDir(), "dist") o := Options{ - Root: root, Dir: "cmd/notes", Version: "v1.0.0", Publisher: newFakePub(), + Root: root, Dir: "cmd/notes", Version: "v1.0.0", Publisher: newFakePub(), DistDir: dist, PushFormula: func(tap, binary, formula, message string) error { pushed = tap; return nil }, } if _, err := Run(o); err != nil { @@ -733,7 +738,7 @@ func TestFromTagKeepsBrewChannel(t *testing.T) { // The republish path: NO Brew in Options — must come from the dir's cfg. pushed = "" o2 := Options{ - Root: root, FromTag: "notes/v1.0.0", Publisher: newFakePub(), SkipTests: true, + Root: root, FromTag: "notes/v1.0.0", Publisher: newFakePub(), SkipTests: true, DistDir: dist, PushFormula: func(tap, binary, formula, message string) error { pushed = tap; return nil }, } if _, err := Run(o2); err != nil {