diff --git a/.github/workflows/create-release-pull-request.yml b/.github/workflows/create-release-pull-request.yml deleted file mode 100644 index 38b4c697b..000000000 --- a/.github/workflows/create-release-pull-request.yml +++ /dev/null @@ -1,47 +0,0 @@ -# https://github.com/Azure/azure-workload-identity/blob/main/.github/workflows/create-release-pull-request.yaml -name: create_release_pull_request -on: - workflow_dispatch: - inputs: - release_version: - description: 'Which version are we creating a release pull request for?' - required: true - based_on_branch: - description: 'Which branch should we base the release pull request on?' - required: true - default: main - -permissions: - contents: write - pull-requests: write - -env: - GO_VERSION: '1.20' - -jobs: - create-release-pull-request: - runs-on: ubuntu-20.04 - steps: - - name: validate version - run: | - echo "${{ github.event.inputs.release_version }}" | grep -E 'v[0-9]+\.[0-9]+\.[0-9]+$' - echo "${{ github.event.inputs.based_on_branch }}" | grep -E '^(main|release-[0-9]+\.[0-9]+)$' - - uses: actions/checkout@v4 - with: - submodules: true - fetch-depth: 0 - ref: "${{ github.event.inputs.based_on_branch }}" - - uses: actions/setup-go@v4 - with: - go-version: ${{ env.GO_VERSION }} - - name: update release manifest - run: make release-manifest - env: - VERSION: "${{ github.event.inputs.release_version }}" - - name: Create release pull request - uses: peter-evans/create-pull-request@v5 - with: - commit-message: "release: update manifest and helm charts for ${{ github.event.inputs.release_version }}" - title: "release: update manifest and helm charts for ${{ github.event.inputs.release_version }}" - branch: "release-${{ github.event.inputs.release_version }}" - base: ${{ github.event.inputs.based_on_branch }} diff --git a/.github/workflows/helm-chart.yml b/.github/workflows/helm-chart.yml new file mode 100644 index 000000000..8d3fa115c --- /dev/null +++ b/.github/workflows/helm-chart.yml @@ -0,0 +1,27 @@ +name: publish_helm_chart + +on: + workflow_run: + workflows: [ "Create, Scan and Publish KDM image" ] + types: [ completed ] + branches: [ release-** ] + +jobs: + release: + runs-on: ubuntu-latest + if: ${{ github.event.workflow_run.conclusion == 'success' }} + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Configure Git + run: | + git config user.name "$GITHUB_ACTOR" + git config user.email "$GITHUB_ACTOR@users.noreply.github.com" + + - name: Run chart-releaser + uses: helm/chart-releaser-action@v1.5.0 + env: + CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" diff --git a/Makefile b/Makefile index cd212d2b6..0bfe71761 100644 --- a/Makefile +++ b/Makefile @@ -187,10 +187,13 @@ lint: $(GOLANGCI_LINT) ## -------------------------------------- ## Release +## To create a release, run `make release VERSION=x.y.z` ## -------------------------------------- .PHONY: release-manifest release-manifest: @sed -i -e 's/^VERSION ?= .*/VERSION ?= ${VERSION}/' ./Makefile @sed -i -e "s/version: .*/version: ${IMG_TAG}/" ./charts/kdm/Chart.yaml @sed -i -e "s/tag: .*/tag: ${IMG_TAG}/" ./charts/kdm/values.yaml - @sed -i -e 's/RELEASE_TAG=.*/RELEASE_TAG=${IMG_TAG}/' ./charts/README.md + @sed -i -e 's/IMG_TAG=.*/IMG_TAG=${IMG_TAG}/' ./charts/README.md + git add ./Makefile ./charts/kdm/Chart.yaml ./charts/kdm/values.yaml ./charts/README.md + git commit -s -m "release: update manifest and helm charts for ${VERSION}"