From 63e96c9715a987a98986cb05cd282faa06ac8e0e Mon Sep 17 00:00:00 2001 From: Szymon Fugas Date: Tue, 21 Jun 2022 15:36:22 +0200 Subject: [PATCH] chore: add release workflow (#750) * Regenerate deepcopy * Add the workflow * Stop signing the tag --- .github/workflows/release.yaml | 56 +++++++++++++++++++++++++++ Makefile | 2 +- api/v1alpha2/zz_generated.deepcopy.go | 4 +- 3 files changed, 59 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/release.yaml diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 000000000..9e5777603 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,56 @@ +name: Release Operator +on: + workflow_dispatch: + +jobs: + build-and-release: + name: Release Operator, build and push newest image + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Set up env vars + run: | + echo "GO111MODULE=on" >> $GITHUB_ENV + echo "GO_VERSION=v$(sed -n 's/GO_VERSION=//p' config.base.env)" >> $GITHUB_ENV + echo "GOPATH=/home/runner/go" >> $GITHUB_ENV + + - name: Prepare go environment + uses: actions/setup-go@v2 + with: + go-version: ${{ env.GO_VERSION }} + + - name: Ensure Golang runtime dependencies + run: make go-dependencies + + - name: Configure Git + run: | + git config user.name "$GITHUB_ACTOR" + git config user.email "$GITHUB_ACTOR@users.noreply.github.com" + + - name: Tag the release + run: make tag + + - name: Set version for release tag name + run: | + echo "VERSION=$(cat VERSION.txt)" >> $GITHUB_ENV + + - name: Release + uses: softprops/action-gh-release@v1 + with: + tag_name: ${{ env.VERSION }} + + - name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} + + - name: Build and push the image to DockerHub + run: | + git reset --hard + make container-runtime-release diff --git a/Makefile b/Makefile index 4bde2c017..8fbe54b94 100644 --- a/Makefile +++ b/Makefile @@ -398,7 +398,7 @@ bump-version: sembump ## Bump the version in the version file. Set BUMP to [ pat .PHONY: tag tag: ## Create a new git tag to prepare to build a release @echo "+ $@" - git tag -s -a $(VERSION) -m "$(VERSION)" + git tag -a $(VERSION) -m "$(VERSION)" git push origin $(VERSION) .PHONY: help diff --git a/api/v1alpha2/zz_generated.deepcopy.go b/api/v1alpha2/zz_generated.deepcopy.go index cfd1b3059..35547563f 100644 --- a/api/v1alpha2/zz_generated.deepcopy.go +++ b/api/v1alpha2/zz_generated.deepcopy.go @@ -23,7 +23,7 @@ package v1alpha2 import ( corev1 "k8s.io/api/core/v1" - rbacv1 "k8s.io/api/rbac/v1" + "k8s.io/api/rbac/v1" "k8s.io/apimachinery/pkg/runtime" ) @@ -400,7 +400,7 @@ func (in *JenkinsSpec) DeepCopyInto(out *JenkinsSpec) { in.ConfigurationAsCode.DeepCopyInto(&out.ConfigurationAsCode) if in.Roles != nil { in, out := &in.Roles, &out.Roles - *out = make([]rbacv1.RoleRef, len(*in)) + *out = make([]v1.RoleRef, len(*in)) copy(*out, *in) } in.ServiceAccount.DeepCopyInto(&out.ServiceAccount)