From cd895b0f7630d4985b18a5533c4c84f9b7f33fb0 Mon Sep 17 00:00:00 2001 From: ahussein3 Date: Wed, 11 Oct 2023 14:16:04 +0200 Subject: [PATCH] enhance CI workflow --- .github/workflows/ci.yml | 4 ++-- Makefile | 13 ++++++++----- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ee6f0b8..8f31392 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,7 +43,6 @@ jobs: - name: Test run: make test - build: runs-on: ubuntu-latest permissions: @@ -98,6 +97,7 @@ jobs: # if: startsWith(github.ref, 'refs/tags/v') permissions: contents: read # for actions/checkout to fetch code + packages: write # to upload images/helm-chart steps: - name: Checkout uses: actions/checkout@v3 @@ -123,7 +123,7 @@ jobs: with: registry: ghcr.io username: ${{ github.actor }} - password: ${{ secrets.BUILD_BOT_USER_WRITE_PACKAGES_PAT }} + password: ${{ secrets.GITHUB_TOKEN }} - name: Build and publish chart run: | diff --git a/Makefile b/Makefile index ccd869e..9013b6e 100644 --- a/Makefile +++ b/Makefile @@ -1,13 +1,16 @@ +VERSION ?= $(shell git describe --tags --always) +# Strip off leading `v`: v0.12.0 -> 0.12.0 +# Seems to be idiomatic for chart versions: https://helm.sh/docs/topics/charts/#the-chart-file +CHART_VERSION := $(shell echo $(VERSION) | sed 's/^v//') # Image URL to use all building/pushing image targets -IMG ?= controller:latest +IMG ?= ghcr.io/weaveworks/cluster-reflector-controller:${VERSION} + +CHART_REGISTRY ?= ghcr.io/weaveworks/charts + # ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary. ENVTEST_K8S_VERSION = 1.28.0 -VERSION ?= $(shell git describe --tags --always) -# Strip off leading `v`: v0.12.0 -> 0.12.0 -# Seems to be idiomatic for chart versions: https://helm.sh/docs/topics/charts/#the-chart-file -CHART_VERSION := $(shell echo $(VERSION) | sed 's/^v//') # Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set) ifeq (,$(shell go env GOBIN))