Skip to content

Commit

Permalink
ci: add goreleaser to build the project
Browse files Browse the repository at this point in the history
adding goreleaser to help in building the
project with different os and architecture.
Later, we'll use the artifact create from this
ci to pass it to krew release yaml.

Signed-off-by: subhamkrai <[email protected]>
  • Loading branch information
subhamkrai committed Jun 16, 2023
1 parent 0d4ae96 commit 2c02eca
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ jobs:
with:
fetch-depth: 0

- name: GoReleaser
uses: goreleaser/goreleaser-action@v1
with:
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# krew-release-bot is a bot that automates the update of plugin manifests in krew-index when a new version of your kubectl plugin is released.
# https://github.com/rajatjindal/krew-release-bot
- name: Update new version in krew-index
Expand Down
28 changes: 28 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
before:
hooks:
- go mod tidy
builds:
- id: kubectl-rook-ceph
main: ./cmd
binary: kubectl-rook-ceph
env:
- CGO_ENABLED=0
goos:
- linux
- darwin
- windows
goarch:
- amd64
- arm64
ignore:
- goos: windows
goarch: arm64

archives:
- builds:
- kubectl-rook-ceph
name_template: "{{ .ProjectName }}_{{ .Tag }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"
wrap_in_directory: false
format: tar.gz
files:
- LICENSE

0 comments on commit 2c02eca

Please sign in to comment.