Skip to content

Commit

Permalink
prepare for release
Browse files Browse the repository at this point in the history
Signed-off-by: zwwhdls <[email protected]>
  • Loading branch information
zwwhdls committed Jul 5, 2024
1 parent 2049c66 commit 6ccb0df
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: release

on:
push:
tags:
- v*

jobs:
releaser:
runs-on: ubuntu-20.04
steps:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 'oldstable'

- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 1

- name: setup release environment
run: |-
REVISIONDATE=$(git log -1 --pretty=format:'%cd' --date short 2>/dev/null)
echo "REVISIONDATE=${REVISIONDATE}" >> $GITHUB_ENV
- name: goreleaser release
run: make release
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
# either 'goreleaser' (default) or 'goreleaser-pro'
distribution: goreleaser
# 'latest', 'nightly', or a semver
version: '~> v2'
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49 changes: 49 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
project_name: kubectl-jfs-plugin
env:
- GO111MODULE=on
- CGO_ENABLED=0
- REVISIONDATE={{ .Env.REVISIONDATE }}
before:
hooks:
- go mod download
builds:
- id: kubectl-jfs-linux-amd64
ldflags: -s -w -X github.com/juicedata/kubectl-jfs-plugin/pkg.version={{.Version}} -X github.com/juicedata/kubectl-jfs-plugin/pkg.gitCommit={{.ShortCommit}} -X github.com/juicedata/kubectl-jfs-plugin/pkg.buildDate={{.Env.REVISIONDATE}}
main: .
goos:
- linux
goarch:
- amd64
- id: kubectl-jfs-linux-arm64
ldflags: -s -w -X github.com/juicedata/kubectl-jfs-plugin/pkg.version={{.Version}} -X github.com/juicedata/kubectl-jfs-plugin/pkg.gitCommit={{.ShortCommit}} -X github.com/juicedata/kubectl-jfs-plugin/pkg.buildDate={{.Env.REVISIONDATE}}
main: .
goos:
- linux
goarch:
- arm64
- id: kubectl-jfs-darwin-amd64
ldflags: -s -w -X github.com/juicedata/kubectl-jfs-plugin/pkg.version={{.Version}} -X github.com/juicedata/kubectl-jfs-plugin/pkg.gitCommit={{.ShortCommit}} -X github.com/juicedata/kubectl-jfs-plugin/pkg.buildDate={{.Env.REVISIONDATE}}
main: .
goos:
- darwin
goarch:
- amd64
- id: kubectl-jfs-darwin-arm64
ldflags: -s -w -X github.com/juicedata/kubectl-jfs-plugin/pkg.version={{.Version}} -X github.com/juicedata/kubectl-jfs-plugin/pkg.gitCommit={{.ShortCommit}} -X github.com/juicedata/kubectl-jfs-plugin/pkg.buildDate={{.Env.REVISIONDATE}}
main: .
goos:
- darwin
goarch:
- arm64
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ .Tag }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
archives:
- name_template: "{{ .ProjectName }}-{{ .Version }}-{{ .Os }}-{{ .Arch }}"
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ GIT_BRANCH?=$(shell git rev-parse --abbrev-ref HEAD)
GIT_COMMIT?=$(shell git rev-parse HEAD)
DEV_TAG=dev-$(shell git describe --always --dirty)
BUILD_DATE?=$(shell date -u +"%Y-%m-%dT%H:%M:%SZ")
REVISIONDATE:=$(shell git log -1 --pretty=format:'%cd' --date short 2>/dev/null)
GO111MODULE=on

.PHONY: build
Expand Down

0 comments on commit 6ccb0df

Please sign in to comment.