Skip to content

Commit 86d7c05

Browse files
tpoundsjirfag
authored andcommitted
Build godownloader/goreleaser tools before use. (#744)
1 parent c427c61 commit 86d7c05

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
/test/path
77
/golangci-lint
88
/tools/Dracula.itermcolors
9+
/tools/godownloader
10+
/tools/goreleaser
911
/tools/node_modules
1012
/tools/svg-term
1113
/.vscode/

Makefile

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@ build: golangci-lint
1818
clean:
1919
rm -f golangci-lint
2020
rm -f test/path
21-
rm -f tools/svg-term
2221
rm -f tools/Dracula.itermcolors
22+
rm -f tools/godownloader
23+
rm -f tools/goreleaser
24+
rm -f tools/svg-term
2325
rm -rf tools/node_modules
2426
.PHONY: fast_build build build_race clean
2527

@@ -63,16 +65,23 @@ fast_check_generated:
6365
git diff --exit-code # check no changes
6466
.PHONY: fast_check_generated
6567

66-
release: export GOFLAGS = -mod=readonly
67-
release: .goreleaser.yml
68-
cd tools && go run github.com/goreleaser/goreleaser --config ../.goreleaser.yml
68+
release: .goreleaser.yml tools/goreleaser
69+
./tools/goreleaser
6970
.PHONY: release
7071

7172
# Non-PHONY targets (real files)
7273

7374
golangci-lint: FORCE
7475
go build -o $@ ./cmd/golangci-lint
7576

77+
tools/godownloader: export GOFLAGS = -mod=readonly
78+
tools/godownloader: tools/go.mod tools/go.sum
79+
cd tools && go build github.com/goreleaser/godownloader
80+
81+
tools/goreleaser: export GOFLAGS = -mod=readonly
82+
tools/goreleaser: tools/go.mod tools/go.sum
83+
cd tools && go build github.com/goreleaser/goreleaser
84+
7685
tools/svg-term: tools/package.json tools/package-lock.json
7786
cd tools && npm ci
7887
ln -sf node_modules/.bin/svg-term $@
@@ -83,9 +92,8 @@ tools/Dracula.itermcolors:
8392
docs/demo.svg: tools/svg-term tools/Dracula.itermcolors
8493
./tools/svg-term --cast=183662 --out docs/demo.svg --window --width 110 --height 30 --from 2000 --to 20000 --profile ./tools/Dracula.itermcolors --term iterm2
8594

86-
install.sh: export GOFLAGS = -mod=readonly
87-
install.sh: .goreleaser.yml
88-
cd tools && go run github.com/goreleaser/godownloader ../.goreleaser.yml | sed '/DO NOT EDIT/s/ on [0-9TZ:-]*//' > ../$@
95+
install.sh: .goreleaser.yml tools/godownloader
96+
./tools/godownloader .goreleaser.yml | sed '/DO NOT EDIT/s/ on [0-9TZ:-]*//' > $@
8997

9098
README.md: FORCE golangci-lint
9199
go run ./scripts/gen_readme/main.go

0 commit comments

Comments
 (0)