1
0
Fork 0
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:
Vyankatesh Kudtarkar 2021-08-10 21:37:46 +05:30 committed by GitHub
parent 08e383a0a3
commit adb0170001
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 59 additions and 3 deletions

View file

@ -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
View file

@ -8,4 +8,5 @@ coverage.txt
cmd/initContainer/kyvernopre
cmd/kyverno/kyverno
cmd/cli/kubectl-kyverno/kyverno
kubectl-kyverno
kubectl-kyverno
/release

View file

@ -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:'

View file

@ -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