From 4a900e36bf1f93c3341d244f34f25d3dda479f54 Mon Sep 17 00:00:00 2001 From: Ravi Suhag Date: Thu, 29 Jun 2023 19:49:21 -0500 Subject: [PATCH] build: update goreleaser config --- .github/workflows/release.yaml | 8 ++--- .goreleaser.yaml | 61 ++++++++++++++++------------------ 2 files changed, 32 insertions(+), 37 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 8db96520..4bab4db6 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -6,10 +6,10 @@ on: - "v*" jobs: - release: + goreleaser: runs-on: ubuntu-latest steps: - - name: Checkout + - name: Checkout code uses: actions/checkout@v2 with: fetch-depth: 0 @@ -24,10 +24,10 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v2.6.1 + uses: goreleaser/goreleaser-action@v4 with: distribution: goreleaser version: latest - args: --rm-dist + args: release --clean env: GITHUB_TOKEN: ${{ secrets.GO_RELEASER_TOKEN }} diff --git a/.goreleaser.yaml b/.goreleaser.yaml index a6a7635b..a119de7b 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -1,16 +1,27 @@ project_name: guardian + release: prerelease: auto + before: hooks: - go mod tidy - make clean + +changelog: + use: github + sort: asc + filters: + exclude: + - "^docs:" + - "^test:" + - "^build:" + builds: - id: "guardian" main: ./main.go binary: guardian - flags: - - -a + flags: [-a] ldflags: - -X github.com/raystack/guardian/core.Version={{.Tag}} - -X github.com/raystack/guardian/core.BuildCommit={{.FullCommit}} @@ -19,37 +30,20 @@ builds: goarch: [amd64, 386, arm, arm64] env: - CGO_ENABLED=0 + archives: - - replacements: - darwin: macos - linux: linux - windows: windows - 386: i386 - amd64: x86_64 + - id: "archives" format_overrides: - goos: windows format: zip -changelog: - sort: asc - filters: - exclude: - - "^docs:" - - "^test:" - - "^build:" -checksum: - name_template: "checksums.txt" -snapshot: - name_template: "{{ .Tag }}-next" + dockers: - - goos: linux - goarch: amd64 - ids: - - guardian - dockerfile: Dockerfile + - id: dockerhub image_templates: - "docker.io/raystack/{{.ProjectName}}:latest" - "docker.io/raystack/{{.ProjectName}}:{{ .Version }}" - "docker.io/raystack/{{.ProjectName}}:{{ .Tag }}-amd64" + nfpms: - maintainer: Raystack description: Universal data access tool @@ -58,15 +52,16 @@ nfpms: formats: - deb - rpm - replacements: - darwin: macOS -scoop: - bucket: - owner: raystack - name: scoop-bucket - homepage: "https://github.com/raystack/guardian" - description: "Universal data access tool" - license: Apache 2.0 + - apk + +scoops: + - homepage: "https://github.com/raystack/guardian" + description: "Universal data access tool" + license: Apache 2.0 + bucket: + owner: raystack + name: scoop-bucket + brews: - name: guardian homepage: "https://github.com/raystack/guardian"