From cba0c511c90cc68b3c9d36164d099da0e41d9edd Mon Sep 17 00:00:00 2001 From: Zuhair AlSader Date: Sun, 30 Jul 2023 12:08:49 -0400 Subject: [PATCH 1/2] ci: autotag and only publish helm on tags Signed-off-by: Zuhair AlSader --- .github/workflows/build-images.yml | 8 ++++++++ .github/workflows/helm-publish.yml | 5 +++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-images.yml b/.github/workflows/build-images.yml index a837d5c..9da36a4 100644 --- a/.github/workflows/build-images.yml +++ b/.github/workflows/build-images.yml @@ -18,6 +18,13 @@ jobs: - name: Check out the repo uses: actions/checkout@v3 + # Extract version data and create tag + - uses: jaliborc/action-general-autotag@1.0.0 + with: + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + source_file: "VERSION" + extraction_regex: "(.*)" + - name: Docker meta id: meta uses: docker/metadata-action@v4 @@ -63,6 +70,7 @@ jobs: build-bundle: name: Build and push bundle Docker image to Docker Hub runs-on: ubuntu-latest + needs: build steps: - name: Check out the repo uses: actions/checkout@v3 diff --git a/.github/workflows/helm-publish.yml b/.github/workflows/helm-publish.yml index f105e6f..54a9f0c 100644 --- a/.github/workflows/helm-publish.yml +++ b/.github/workflows/helm-publish.yml @@ -2,8 +2,8 @@ name: Release Charts on: push: - branches: - - main + tags: + - 'v*' jobs: release: @@ -12,6 +12,7 @@ jobs: permissions: contents: write runs-on: ubuntu-latest + needs: build steps: - name: Checkout uses: actions/checkout@v3 From bc42ac4e9692d759dba2e027b6585380c5b7ad17 Mon Sep 17 00:00:00 2001 From: Zuhair AlSader Date: Sun, 30 Jul 2023 12:13:21 -0400 Subject: [PATCH 2/2] docs: update release instructions Signed-off-by: Zuhair AlSader --- RELEASE.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/RELEASE.md b/RELEASE.md index 0cfe010..82cd305 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -3,12 +3,11 @@ To create a new release (example is for release `v0.1.0`): 1. Increase the version according to Semantic Versioning in the [`VERSION` file](VERSION). -2. Run `make all` which updates `appVersion` in [the `Chart.yaml` of the helm chart.](charts/koor-operator/Chart.yaml) Update chart version. +2. Run `make` which updates `version` and `appVersion` in [the `Chart.yaml` of the helm chart.](charts/koor-operator/Chart.yaml) 3. Check out a new branch, which will be used for the pull request to update the version: `git checkout -b BRANCH_NAME` 4. Commit these changes now using `git commit -s -S`. 5. Push the branch using `git push -u origin BRANCH_NAME` with these changes and create a pull request on [GitHub](https://github.com/koor-tech/koor-operator). 6. Wait for pull request to be approved and merge it (if you have access to do so). -7. Create the new tag using `git tag v0.1.0` and then run `git push -u origin v0.1.0` -8. In a few minutes, the CI should have built and published a draft of the release here [GitHub - Releases List](https://github.com/koor-tech/koor-operator/releases). -9. Now edit the release and use the green button to publish the release. -10. Congratulations! The release is now fully published. +7. In a few minutes, the CI should have built and published a draft of the release here [GitHub - Releases List](https://github.com/koor-tech/koor-operator/releases). +8. Now edit the release and use the green button to publish the release. +9. Congratulations! The release is now fully published.