mirror of
https://github.com/kyverno/kyverno.git
synced 2024-12-14 11:57:48 +00:00
Automate CLI binaries releases (#2236)
* fix issue * fix comment * fix comment * fix comment * add md file * ignore /release * fix issue
This commit is contained in:
parent
08e383a0a3
commit
adb0170001
4 changed files with 59 additions and 3 deletions
51
.github/workflows/release.yaml
vendored
51
.github/workflows/release.yaml
vendored
|
@ -123,6 +123,57 @@ jobs:
|
|||
- name : docker images publish
|
||||
run: |
|
||||
make docker-publish-cli
|
||||
|
||||
create-release:
|
||||
runs-on: ubuntu-latest
|
||||
needs:
|
||||
- release-init-kyverno
|
||||
- release-kyverno
|
||||
- release-kyverno-cli
|
||||
steps:
|
||||
- name: Set version
|
||||
id: version
|
||||
run: echo ::set-output name=version::${GITHUB_REF#refs/*/}
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: 1.16
|
||||
|
||||
- name: Cache Go modules
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ~/go/pkg/mod
|
||||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-go-
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: 1.16
|
||||
- uses: creekorful/goreportcard-action@v1.0
|
||||
|
||||
- name: Make Release
|
||||
env:
|
||||
VERSION: ${{ steps.version.outputs.version }}
|
||||
run: |
|
||||
rm -rf release
|
||||
mkdir release
|
||||
make release-notes > release/release-notes.out
|
||||
cat release/release-notes.out
|
||||
|
||||
- name: Run GoReleaser
|
||||
uses: goreleaser/goreleaser-action@v2
|
||||
with:
|
||||
version: latest
|
||||
args: release --rm-dist --debug --release-notes=release/release-notes.out
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
release-cli-via-krew:
|
||||
runs-on: ubuntu-latest
|
||||
|
|
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -8,4 +8,5 @@ coverage.txt
|
|||
cmd/initContainer/kyvernopre
|
||||
cmd/kyverno/kyverno
|
||||
cmd/cli/kubectl-kyverno/kyverno
|
||||
kubectl-kyverno
|
||||
kubectl-kyverno
|
||||
/release
|
||||
|
|
|
@ -42,9 +42,8 @@ release:
|
|||
changelog:
|
||||
sort: asc
|
||||
filters:
|
||||
# commit messages matching the regexp listed here will be removed from
|
||||
# the changelog
|
||||
exclude:
|
||||
- '^docs:'
|
||||
- typo
|
||||
- '^test:'
|
||||
|
||||
|
|
5
Makefile
5
Makefile
|
@ -9,6 +9,7 @@ GIT_HASH := $(GIT_BRANCH)/$(shell git log -1 --pretty=format:"%H")
|
|||
TIMESTAMP := $(shell date '+%Y-%m-%d_%I:%M:%S%p')
|
||||
CONTROLLER_GEN=controller-gen
|
||||
CONTROLLER_GEN_REQ_VERSION := v0.4.0
|
||||
VERSION ?= $(shell git describe --always --tags)
|
||||
|
||||
REGISTRY?=ghcr.io
|
||||
REPO=$(REGISTRY)/kyverno
|
||||
|
@ -220,6 +221,10 @@ release:
|
|||
kustomize build ./definitions > ./definitions/install.yaml
|
||||
kustomize build ./definitions > ./definitions/release/install.yaml
|
||||
|
||||
release-notes:
|
||||
@bash -c 'while IFS= read -r line ; do if [[ "$$line" == "## "* && "$$line" != "## $(VERSION) "* ]]; then break ; fi; echo "$$line"; done < "CHANGELOG.md"' \
|
||||
true
|
||||
|
||||
kyverno-crd: controller-gen
|
||||
$(CONTROLLER_GEN) crd paths=./pkg/api/kyverno/v1alpha1 output:dir=./definitions/crds
|
||||
$(CONTROLLER_GEN) crd paths=./pkg/api/kyverno/v1 output:dir=./definitions/crds
|
||||
|
|
Loading…
Reference in a new issue