-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from dominikwinter/10-goreleaser-for-automatic…
…-release-of-new-go-versions add goreleaser
- Loading branch information
Showing
4 changed files
with
106 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: goreleaser | ||
|
||
on: | ||
push: | ||
tags: | ||
- "*" | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
goreleaser: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- | ||
name: Fetch all tags | ||
run: git fetch --force --tags | ||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: 1.22 | ||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v5 | ||
with: | ||
distribution: goreleaser | ||
version: ${{ env.GITHUB_REF_NAME }} | ||
args: release --clean | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.PUBLISHER_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
builds: | ||
- binary: pno | ||
goos: | ||
- darwin | ||
- linux | ||
- windows | ||
goarch: | ||
- amd64 | ||
- arm64 | ||
env: | ||
- CGO_ENABLED=0 | ||
flags: | ||
- -mod=vendor | ||
|
||
release: | ||
prerelease: auto | ||
|
||
universal_binaries: | ||
- replace: true | ||
|
||
brews: | ||
- | ||
name: pno | ||
homepage: https://github.com/dominikwinter/pno | ||
tap: | ||
owner: dominikwinter | ||
name: homebrew-tap | ||
|
||
checksum: | ||
name_template: checksum.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,35 @@ | ||
.PHONY: default | ||
default: build | ||
|
||
help: Makefile ## Display this help | ||
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "; printf "Usage:\n\n make \033[36m<target>\033[0m [VARIABLE=value...]\n\nTargets:\n\n"}; {printf " \033[36m%-10s\033[0m %s\n", $$1, $$2}' | ||
|
||
.PHONY: run | ||
run: | ||
run: ## Run app for development | ||
go run | ||
|
||
.PHONY: test | ||
test: | ||
test: ## Run tests | ||
go test -v --race -cpu 2 -cover -shuffle on -vet '' ./... | ||
|
||
.PHONY: build | ||
build: | ||
go build -trimpath -o ./bin/pno | ||
go build -ldflags="-s -w" -trimpath -o ./bin/pno | ||
|
||
.PHONY: install | ||
install: | ||
install: ## Install app | ||
install -b -S -v ./bin/pno ${GOPATH}/bin/. | ||
|
||
.PHONY: clean | ||
clean: | ||
clean: ## Clean up | ||
rm -rf ./bin/* | ||
go mod tidy | ||
|
||
.PHONY: release | ||
release: | ||
release: ## Build release binaries | ||
mkdir -p bin | ||
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -o bin/pno-macos-arm64 | ||
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o bin/pno-linux-amd64 | ||
CGO_ENABLED=0 GOOS=linux GOARCH=386 go build -o bin/pno-linux-386 | ||
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o bin/pno-windows-amd64.exe | ||
CGO_ENABLED=0 GOOS=windows GOARCH=386 go build -o bin/pno-windows-386.exe | ||
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -ldflags="-s -w" -trimpath -o bin/pno-macos-arm64 | ||
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -trimpath -o bin/pno-linux-amd64 | ||
CGO_ENABLED=0 GOOS=linux GOARCH=386 go build -ldflags="-s -w" -trimpath -o bin/pno-linux-386 | ||
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags="-s -w" -trimpath -o bin/pno-windows-amd64.exe | ||
CGO_ENABLED=0 GOOS=windows GOARCH=386 go build -ldflags="-s -w" -trimpath -o bin/pno-windows-386.exe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters