Skip to content

Commit 1fb21c6

Browse files
authored
Merge pull request #80 from gaurab-khanal/githubrelease
Add automation for gitub release using goreleaser
2 parents 133373b + b374252 commit 1fb21c6

3 files changed

Lines changed: 70 additions & 1 deletion

File tree

.github/workflows/gorelease.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
2+
name: goreleaser
3+
4+
on:
5+
push:
6+
tags:
7+
- "v*"
8+
9+
permissions:
10+
contents: write
11+
12+
jobs:
13+
goreleaser:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
- name: Set up Go
21+
uses: actions/setup-go@v5
22+
with:
23+
go-version: stable
24+
- name: Run GoReleaser
25+
uses: goreleaser/goreleaser-action@v6
26+
with:
27+
distribution: goreleaser
28+
version: "latest"
29+
args: release --clean
30+
env:
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,6 @@ kubeconfig
5757
.cursor_prompts/
5858

5959
# Local dev notes
60-
.dev_notes/
60+
.dev_notes/
61+
# Added by goreleaser init:
62+
dist/

.goreleaser.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
version: 2
2+
3+
project_name: kubectl-plugin
4+
5+
builds:
6+
- env:
7+
- CGO_ENABLED=0
8+
goos:
9+
- linux
10+
- windows
11+
- darwin
12+
goarch:
13+
- amd64
14+
- arm64
15+
16+
archives:
17+
- name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
18+
format_overrides:
19+
- goos: windows
20+
formats: [zip]
21+
22+
23+
changelog:
24+
use: github
25+
sort: asc
26+
format: "{{ .SHA }}: {{ .Message }}"
27+
28+
checksum:
29+
name_template: "{{ .ProjectName }}_checksums.txt"
30+
31+
release:
32+
footer: >-
33+
34+
---
35+
36+
Released by [GoReleaser](https://github.com/goreleaser/goreleaser).

0 commit comments

Comments
 (0)