From 5ef8121e2c675990c46bb5ca68ffa7e03084067f Mon Sep 17 00:00:00 2001 From: Vincent Demeester Date: Thu, 25 Jan 2024 16:10:18 +0100 Subject: [PATCH] Add a .goreleaser configuration and workflow Signed-off-by: Vincent Demeester --- .github/workflows/release.yaml | 23 +++++++++++++++++++ .goreleaser.yml | 42 ++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 .github/workflows/release.yaml create mode 100644 .goreleaser.yml diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 00000000..33d64644 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,23 @@ +name: release + +on: + push: + tags: + - '*' + +jobs: + goreleaser: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 + - run: git fetch --prune --unshallow + uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5 + with: + go-version: 1.20.x + cache: true + - uses: goreleaser/goreleaser-action@v4.2.0 + with: + version: latest + args: release --timeout=60m --rm-dist + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 00000000..d95301a9 --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,42 @@ +before: + hooks: + - sed -i 's/devel/{{ .Tag }}/' ./pkg/version.json +builds: +- main: . + binary: catalog-cd + env: + - CGO_ENABLED=0 + flags: + - -trimpath + goos: + - windows + - linux + - darwin + goarch: + - amd64 + - arm64 + - s390x + - "386" + - mips64le + - ppc64le +archives: +- name_template: "{{ .Binary }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}" + replacements: + darwin: Darwin + linux: Linux + windows: Windows + 386: i386 + amd64: x86_64 +checksum: + name_template: 'checksums.txt' +snapshot: + name_template: "{{ .Tag }}-next" +changelog: + sort: asc + use: github + filters: + exclude: + - '^docs:' + - '^test:' + +