diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..4726364 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,26 @@ +name: goreleaser + +on: + push: + tags: + - '*' + +jobs: + goreleaser: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: 1.21.x + + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v5 + with: + version: latest + args: release --clean + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 0000000..cd70d13 --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,30 @@ +builds: + - binary: go-cacher + main: ./cmd/go-cacher + goos: + - darwin + - linux + goarch: + - amd64 + - arm64 + goarm: + - '6' + env: + - CGO_ENABLED=0 + mod_timestamp: '{{ .CommitTimestamp }}' + flags: + - -trimpath + ldflags: + - -s -w # Don't set main.version. + +archives: + - name_template: "{{.Binary}}_{{.Os}}_{{.Arch}}" + files: + - README.md + - LICENSE + +release: + draft: true + +checksum: + name_template: "go-tool-cache_checksums.txt"