Skip to content

Commit

Permalink
release script
Browse files Browse the repository at this point in the history
  • Loading branch information
ingon committed Dec 29, 2024
1 parent 8871cbf commit 516ba34
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.env
.direnv
result
dist
23 changes: 23 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,26 @@ update-go:

update-nix:
nix flake update

.PHONY: release-clean release-build release-archive release

release-clean:
rm -rf dist/

release-build:
GOOS=darwin GOARCH=amd64 go build -v -o dist/build/darwin-amd64/connet github.com/keihaya-com/connet/cmd/connet
GOOS=darwin GOARCH=arm64 go build -v -o dist/build/darwin-arm64/connet github.com/keihaya-com/connet/cmd/connet
GOOS=linux GOARCH=amd64 go build -v -o dist/build/linux-amd64/connet github.com/keihaya-com/connet/cmd/connet
GOOS=linux GOARCH=arm64 go build -v -o dist/build/linux-arm64/connet github.com/keihaya-com/connet/cmd/connet
GOOS=freebsd GOARCH=amd64 go build -v -o dist/build/freebsd-amd64/connet github.com/keihaya-com/connet/cmd/connet
GOOS=freebsd GOARCH=arm64 go build -v -o dist/build/freebsd-arm64/connet github.com/keihaya-com/connet/cmd/connet
GOOS=windows GOARCH=amd64 go build -v -o dist/build/windows-amd64/connet github.com/keihaya-com/connet/cmd/connet
GOOS=windows GOARCH=arm64 go build -v -o dist/build/windows-arm64/connet github.com/keihaya-com/connet/cmd/connet

release-version := $(shell git describe --exact-match --tags 2> /dev/null || git rev-parse --short HEAD)

release-archive:
mkdir dist/archive
for x in $(shell ls dist/build); do tar -czf dist/archive/connet-$(release-version)-$$x.tar.gz -C dist/build/$$x connet; done

release: release-clean release-build release-archive

0 comments on commit 516ba34

Please sign in to comment.