From 2fd776c417d93c17427a83562bae2f296f74315d Mon Sep 17 00:00:00 2001 From: wangxye Date: Fri, 24 Nov 2023 17:18:28 +0800 Subject: [PATCH 1/3] chore: relase when the tag starts with helm Signed-off-by: wangxye --- .github/workflows/release.yml | 44 ++++++++++++++++++- .../charts/automq-for-rocketmq/Chart.yaml | 4 +- 2 files changed, 45 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ebce5cbdd..2f22da549 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,9 +3,51 @@ name: Release Charts on: push: tags: - - 'v[0-9]+\.[0-9]+\.[0-9]+' + - 'helm-v[0-9]+\.[0-9]+\.[0-9]+' + +env: + DOCKER_REPO: automqinc/automq-for-rocketmq jobs: + build: + runs-on: ubuntu-latest + if: always() + timeout-minutes: 30 + outputs: + version-json: ${{ steps.build_images.outputs.nightly-version }} + steps: + - uses: actions/checkout@v3 + with: + submodules: true + - name: Install flatc + run: sudo bash install_flatc.sh + - uses: actions/setup-java@v3 + with: + distribution: "temurin" + java-version: "17" + cache: "maven" + - name: Build with Maven + run: | + mvn -Prelease-all clean install -U + - name: docker-login + uses: docker/login-action@v2 + with: + registry: ${{ env.REGISTRY }} + username: ${{ secrets.DOCKERHUB_USER }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Build and save docker images + id: build_images + working-directory: ./distribution/docker + env: + DOCKER_REPO: ${{ env.DOCKER_REPO }} + DOCKER_NIGHTLY_VERSION: ${{ env.DOCKER_NIGHTLY_VERSION }} + run: | + FULL_NODE_VERSION=$(git ls-remote --tags | awk -F '/' 'END{print $3}') + VERSION=${FULL_NODE_VERSION} + sh build-ci.sh ${DOCKER_REPO} ${VERSION} + docker push ${DOCKER_REPO}:${VERSION} + + release: permissions: contents: write diff --git a/distribution/helm/charts/automq-for-rocketmq/Chart.yaml b/distribution/helm/charts/automq-for-rocketmq/Chart.yaml index a056b7888..49ad3c2c0 100644 --- a/distribution/helm/charts/automq-for-rocketmq/Chart.yaml +++ b/distribution/helm/charts/automq-for-rocketmq/Chart.yaml @@ -31,10 +31,10 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.0.2 +version: 0.0.3 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "0.0.2" +appVersion: "0.0.3" From 6ae315b03465aed452d26fcd39972e22f5f3c222 Mon Sep 17 00:00:00 2001 From: wangxye Date: Mon, 27 Nov 2023 10:34:00 +0800 Subject: [PATCH 2/3] chore: release helm only in helm tag Signed-off-by: wangxye --- .github/workflows/release-helm.yml | 35 ++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/release-helm.yml diff --git a/.github/workflows/release-helm.yml b/.github/workflows/release-helm.yml new file mode 100644 index 000000000..3d00105e1 --- /dev/null +++ b/.github/workflows/release-helm.yml @@ -0,0 +1,35 @@ +name: Release Charts + +on: + push: + tags: + - 'helm-v[0-9]+\.[0-9]+\.[0-9]+' + +env: + DOCKER_REPO: automqinc/automq-for-rocketmq + +jobs: + release_helm_chart: + permissions: + contents: write + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + 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: Install Helm + uses: azure/setup-helm@v3 + + - name: Run chart-releaser + uses: helm/chart-releaser-action@v1.6.0 + with: + charts_dir: distribution/helm/charts + env: + CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" \ No newline at end of file From c6b4d12c01affe15d6cee33701ef69792cc49fda Mon Sep 17 00:00:00 2001 From: wangxye Date: Mon, 27 Nov 2023 10:36:23 +0800 Subject: [PATCH 3/3] chore: support build image in official release Signed-off-by: wangxye --- .github/workflows/release.yml | 34 ++++------------------------------ 1 file changed, 4 insertions(+), 30 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2f22da549..4aca0312c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,18 +3,16 @@ name: Release Charts on: push: tags: - - 'helm-v[0-9]+\.[0-9]+\.[0-9]+' + - 'v[0-9]+\.[0-9]+\.[0-9]+' env: DOCKER_REPO: automqinc/automq-for-rocketmq jobs: - build: + build_images: runs-on: ubuntu-latest if: always() timeout-minutes: 30 - outputs: - version-json: ${{ steps.build_images.outputs.nightly-version }} steps: - uses: actions/checkout@v3 with: @@ -45,30 +43,6 @@ jobs: FULL_NODE_VERSION=$(git ls-remote --tags | awk -F '/' 'END{print $3}') VERSION=${FULL_NODE_VERSION} sh build-ci.sh ${DOCKER_REPO} ${VERSION} + docker tag ${DOCKER_REPO}:${VERSION} ${DOCKER_REPO}:latest docker push ${DOCKER_REPO}:${VERSION} - - - release: - permissions: - contents: write - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - 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: Install Helm - uses: azure/setup-helm@v3 - - - name: Run chart-releaser - uses: helm/chart-releaser-action@v1.6.0 - with: - charts_dir: distribution/helm/charts - env: - CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" \ No newline at end of file + docker push ${DOCKER_REPO}:latest \ No newline at end of file