-
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.
- Loading branch information
Showing
5 changed files
with
138 additions
and
0 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,29 @@ | ||
name: release | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- | ||
name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.20 | ||
- | ||
name: GoReleaser | ||
uses: goreleaser/[email protected] | ||
with: | ||
args: release --rm-dist | ||
env: | ||
GITHUB_REF_NAME: ${{ env.GIT_REF }} | ||
GITHUB_TOKEN: ${{ secrets.GORELEASER_GITHUB_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,27 @@ | ||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
name: build | ||
jobs: | ||
|
||
build: | ||
strategy: | ||
matrix: | ||
platform: [macos-latest, ubuntu-latest] | ||
runs-on: ${{ matrix.platform }} | ||
steps: | ||
- | ||
uses: actions/checkout@v3 | ||
- | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.20 | ||
- | ||
name: Verify | ||
run: make verify-ci | ||
- | ||
name: Build | ||
run: make build |
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,51 @@ | ||
env: | ||
- GO111MODULE=on | ||
|
||
before: | ||
hooks: | ||
- go mod tidy | ||
|
||
builds: | ||
- env: | ||
- CGO_ENABLED=0 | ||
binary: pkup | ||
main: ./main.go | ||
ldflags: | ||
- -s -w -X main.version=v{{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}} -X main.builtBy=goreleaser | ||
goos: | ||
- linux | ||
- darwin | ||
goarch: | ||
- "386" | ||
- amd64 | ||
- arm | ||
- arm64 | ||
goarm: | ||
- "7" | ||
|
||
archives: | ||
- files: | ||
- README.md | ||
- LICENSE | ||
|
||
brews: | ||
- homepage: "http://github.com/pPrecel/pkup-gen" | ||
description: "Simple tool to generate PKUP artifacts." | ||
tap: | ||
owner: pPrecel | ||
name: homebrew-tap | ||
goarm: "7" | ||
commit_msg_template: "Brew formula update for {{ .ProjectName }} version {{ .Tag }}" | ||
folder: Formula | ||
license: "MIT" | ||
test: | | ||
system "#{bin}/pkup" | ||
install: | | ||
bin.install "pkup" | ||
checksum: | ||
name_template: 'checksums.txt' | ||
snapshot: | ||
name_template: "{{ incpatch .Version }}" | ||
changelog: | ||
sort: asc |
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,3 +1,7 @@ | ||
.PHONY: build | ||
build: | ||
go build -o .out/pkup main.go | ||
|
||
.PHONY: verify | ||
verify: | ||
./hack/verify.sh |
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,27 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
echo ">==( go mod verify )===" | ||
go mod verify | ||
echo "<==( OK )===" | ||
echo "" | ||
|
||
echo ">==( gofmt -d . )===" | ||
fmt=$(gofmt -l .) | ||
if [ "$fmt" != "" ]; then | ||
echo $fmt | ||
exit 1 | ||
fi | ||
echo "<==( OK )===" | ||
echo "" | ||
|
||
echo ">==( go vet ./... )===" | ||
go vet ./... | ||
echo "<==( OK )===" | ||
echo "" | ||
|
||
echo ">==( go test --cover --race -timeout 30s ./... )===" | ||
go test --cover --race -timeout 30s ./... | ||
echo "<==( OK )===" | ||
echo "" |