From 9c8b19ae98516c6ff6a2b9f42d567ad84223ca3f Mon Sep 17 00:00:00 2001 From: Sergi Castro Date: Tue, 1 Oct 2024 18:41:31 +0200 Subject: [PATCH 1/2] Add action to release new versions --- .github/workflows/make-release.yaml | 30 +++++++++++++++++++ .../{release.yaml => publish-release.yaml} | 4 +-- 2 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/make-release.yaml rename .github/workflows/{release.yaml => publish-release.yaml} (95%) diff --git a/.github/workflows/make-release.yaml b/.github/workflows/make-release.yaml new file mode 100644 index 0000000..085823d --- /dev/null +++ b/.github/workflows/make-release.yaml @@ -0,0 +1,30 @@ +name: Create Release + +on: + workflow_dispatch: + inputs: + version: + description: 'Version to release in the format v0.0.0-tetrate-v0' + required: true + branch: + description: 'Branch to release from. Like release-v0.0.0' + required: true + +jobs: + update-kubegres-yaml: + runs-on: ubuntu-latest + env: + IMG: tetrate/kubegres:${{ github.event.inputs.version }} + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ github.event.inputs.branch }} + - name: Update kubegres.yaml + run: make deploy + - name: Create and push the new tag + run: | + git add kubegres.yaml config/manager/kustomization.yaml + git commit -m "pre-release-tag: Update kubegres.yaml to version ${{ github.event.inputs.version }}" + git push origin ${{ github.event.inputs.branch }} + git tag ${{ github.event.inputs.version }} + git push origin ${{ github.event.inputs.version }} diff --git a/.github/workflows/release.yaml b/.github/workflows/publish-release.yaml similarity index 95% rename from .github/workflows/release.yaml rename to .github/workflows/publish-release.yaml index 1bec2b1..5233e2e 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/publish-release.yaml @@ -1,4 +1,4 @@ -name: Release +name: Publish Release on: push: @@ -8,7 +8,7 @@ env: GOPROXY: https://proxy.golang.org jobs: - docker-hub: + docker-hub-push: runs-on: ubuntu-latest env: IMG: tetrate/kubegres:${{ github.ref_name }} From c68f478517be9119fb6844ebe0ae982737ec91de Mon Sep 17 00:00:00 2001 From: Sergi Castro Date: Wed, 2 Oct 2024 10:59:16 +0200 Subject: [PATCH 2/2] update readme --- README.md | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index dd0b5d5..e1e214c 100644 --- a/README.md +++ b/README.md @@ -68,9 +68,12 @@ and on [https://www.kubegres.io](https://www.kubegres.io). More details in the [ While waiting for PRs to be accepted in the upstream repository and a new version to be released, follow the next instructions to publish our own builds: - Define the new version name by following the pattern `-tetrate-v`, for example `v1.16.0-tetrate-v0` is the first CVEs fixing patch for v1. 16.0 kubegres. -- Run `IMG=tetrate/kubegres: make deploy` with the new version tag to update `kubegres.yaml` file and open a PR with the changes. -- Once the PR is approved and merged create a tag with the new version and push it to the repository. Check that this triggers the release action that will: - - Scan for CVEs in the new version. - - Build the binaries for the new version. - - Build the docker images and push them to the tetrate docker hub repository. - - Run acceptance tests. +- Once the PR is approved: + - Run the Make Release including the new version name and the source branch from where make the release. This will: + - Update the kubegres.yaml file with the new version. By running `IMG=tetrate/kubegres: make deploy`. + - Create the tag and push it to the repository, along to the new commit in the given branch. + - Once this action is done, the release action will be triggered and will: + - Scan for CVEs in the new version. + - Build the binaries for the new version. + - Build the docker images and push them to the tetrate docker hub repository. + - Run acceptance tests.