Skip to content

Commit

Permalink
build: upgrade goreleaser to v2
Browse files Browse the repository at this point in the history
  • Loading branch information
ravisuhag committed Jun 14, 2024
1 parent fd8b816 commit fb7e93a
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 44 deletions.
12 changes: 5 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,25 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
# See https://goreleaser.com/ci/actions/#fetch-depthness
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- run: git fetch --force --tags
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: "1.20"
go-version: "stable"
cache: true
check-latest: true
- name: Get release tag
id: get_version
uses: battila7/get-version-action@v2
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2.6.1
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: latest
args: --snapshot --rm-dist
version: ~v2
args: --snapshot --clean
- name: Login to GitHub Packages Docker Registry
uses: docker/login-action@v1
with:
Expand Down
16 changes: 7 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,34 @@ name: release
on:
push:
tags:
- 'v*.*.*'
- "v*.*.*"
workflow_dispatch:

jobs:
release:
runs-on: ubuntu-latest
steps:
# See https://goreleaser.com/ci/actions/#fetch-depthness
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- run: git fetch --force --tags
- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: '^1.20'
go-version: "stable"
cache: true
check-latest: true
- name: Login to DockerHub
uses: docker/login-action@v1
with:
registry: docker.io
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2.6.1
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: latest
args: --rm-dist
version: ~v2
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GO_RELEASER_TOKEN }}
43 changes: 15 additions & 28 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
version: 2

project_name: meteor

release:
Expand Down Expand Up @@ -25,34 +27,19 @@ builds:
- -X github.com/raystack/meteor/cmd.Version={{.Tag}}
- -X github.com/raystack/meteor/cmd.BuildCommit={{.FullCommit}}
- -X github.com/raystack/meteor/cmd.BuildDate={{.Date}}
goos: [linux]
goarch: [amd64, arm64] # skip goarch 386 and arm due to conflicts with "github.com/blastrain/vitess-sqlparser" library
env:
- CGO_ENABLED=0
- main: ./main.go
id: "darwin"
binary: meteor
flags: [-a]
ldflags:
- -X github.com/raystack/meteor/cmd.Version={{.Tag}}
- -X github.com/raystack/meteor/cmd.BuildCommit={{.FullCommit}}
- -X github.com/raystack/meteor/cmd.BuildDate={{.Date}}
goos: [darwin]
goarch: [amd64, 386, arm, arm64]
env:
- CGO_ENABLED=0
- main: ./main.go
id: "windows"
binary: meteor
flags: [-a]
ldflags:
- -X github.com/raystack/meteor/cmd.Version={{.Tag}}
- -X github.com/raystack/meteor/cmd.BuildCommit={{.FullCommit}}
- -X github.com/raystack/meteor/cmd.BuildDate={{.Date}}
goos: [windows]
goos: ["linux", "windows"]
goarch: [amd64, arm64] # skip goarch 386 and arm due to conflicts with "github.com/blastrain/vitess-sqlparser" library
env:
- CGO_ENABLED=0
ignore: # skip goarch 386 and arm due to conflicts with "github.com/blastrain/vitess-sqlparser" library
- goos: linux
goarch: 386
- goos: linux
goarch: arm
- goos: windows
goarch: 386
- goos: windows
goarch: arm

archives:
- id: "archives"
Expand Down Expand Up @@ -91,19 +78,19 @@ scoops:
- homepage: "https://github.com/raystack/meteor"
description: "Metadata collection tool."
license: Apache 2.0
bucket:
repository:
owner: raystack
name: scoop-bucket

brews:
- name: meteor
homepage: "https://github.com/raystack/meteor"
description: "Metadata collection tool."
tap:
repository:
owner: raystack
name: homebrew-tap
license: "Apache 2.0"
folder: Formula
directory: Formula
dependencies:
- name: git
install: |-
Expand Down

0 comments on commit fb7e93a

Please sign in to comment.