Skip to content

Commit

Permalink
Add release pipeline
Browse files Browse the repository at this point in the history
Signed-off-by: Ivan Sim <[email protected]>
  • Loading branch information
ihcsim committed Sep 1, 2024
1 parent e537206 commit 9d4d6b8
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 1 deletion.
22 changes: 21 additions & 1 deletion .github/workflows/build.yaml → .github/workflows/default.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
name: build
name: default
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:

permissions:
contents: read
Expand Down Expand Up @@ -35,3 +36,22 @@ jobs:
with:
name: build
- run: make test

release:
needs: test
if: ${{ github.event_name == 'workflow_dispatch' }}
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5
- uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: '~> v2'
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ bin
kubelet.log
kubelet-v1.31.0
kubelet/run

dist/
30 changes: 30 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
version: 2

before:
hooks:
- make lint
- make test

builds:
- env:
- CGO_ENABLED=0
goos:
- linux

archives:
- format: tar.gz
# this name template makes the OS and Arch compatible with the results of `uname`.
name_template: >-
{{ .ProjectName }}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch | tolower }}{{ end }}
{{- if .Arm }}v{{ .Arm }}{{ end }}
changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"

0 comments on commit 9d4d6b8

Please sign in to comment.