diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..f42ad98 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,32 @@ +name: Release + +on: + push: + tags: + - 'v*' + +permissions: + contents: write + +jobs: + goreleaser: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: '1.26.1' + + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v6 + with: + distribution: goreleaser + version: latest + args: release --clean + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 0000000..8d973f3 --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,78 @@ +version: 2 + +before: + hooks: + - go mod tidy + - go generate ./... + +builds: + - id: tar-diff + main: ./cmd/tar-diff + binary: tar-diff + env: + - CGO_ENABLED=0 + goos: + - linux + - windows + - darwin + goarch: + - amd64 + - arm64 + ldflags: + - -s -w + + - id: tar-patch + main: ./cmd/tar-patch + binary: tar-patch + env: + - CGO_ENABLED=0 + goos: + - linux + - windows + - darwin + goarch: + - amd64 + - arm64 + ldflags: + - -s -w + +archives: + - formats: ["tar.gz"] + name_template: >- + {{ .ProjectName }}_{{ .Version }}_ + {{- title .Os }}_ + {{- if eq .Arch "amd64" }}x86_64 + {{- else if eq .Arch "386" }}i386 + {{- else }}{{ .Arch }}{{ end }} + {{- if .Arm }}v{{ .Arm }}{{ end }} + format_overrides: + - goos: windows + formats: ["zip"] + files: + - README.md + - LICENSE + - file-format.md + +checksum: + name_template: 'checksums.txt' + +snapshot: + version_template: "{{ incpatch .Version }}-next" + +changelog: + sort: asc + filters: + exclude: + - '^docs:' + - '^test:' + +release: + draft: false + prerelease: auto + mode: replace + header: | + ## Release {{ .Tag }} + + This release includes binaries for multiple platforms and architectures. + footer: | + **Full Changelog**: https://github.com/containers/tar-diff/compare/{{ .PreviousTag }}...{{ .Tag }} \ No newline at end of file