From f2ea91a05d10e33e497bbc5bbf43378d1160abda Mon Sep 17 00:00:00 2001 From: Esteban Borai Date: Fri, 24 Nov 2023 17:39:51 -0300 Subject: [PATCH] hotfix: patch/push packageset `stable` --- .github/workflows/release.yml | 479 ++++++++++++++++++---------------- actions/hotpatch.sh | 14 + 2 files changed, 264 insertions(+), 229 deletions(-) create mode 100755 actions/hotpatch.sh diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5c9196b5db..cdafcee2e2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,6 +19,11 @@ on: required: true description: '' default: true + hotpatch: + type: boolean + required: true + description: '' + default: false workflow_call: inputs: @@ -38,256 +43,272 @@ env: RELEASE: true # Needed so `make` targets make public changes jobs: - cd_dev_check: - name: CD_Dev check + hotpatch: + name: Hotpatch strategy: fail-fast: false runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Get status of latest CD_Dev run - id: cd_dev_check - run: make latest-cd-dev-status - setup_job: - name: Setup workflow - needs: [cd_dev_check] - runs-on: ubuntu-latest - outputs: - VERSION: ${{ steps.version_step.outputs.VERSION }} - TARGET_SHA: ${{ steps.version_step.outputs.GIT_SHA }} - INSTALLER_URL: ${{ steps.installer_step.outputs.INSTALLER_URL }} - steps: - - name: Set target sha and Fluvio version - id: version_step - run: | - if [[ -z "${{ github.event.inputs.commit }}" ]]; then - export GITHUB_VERSION=$(curl -fsS https://raw.githubusercontent.com/infinyon/fluvio/${{ github.sha }}/VERSION) - echo "VERSION=${GITHUB_VERSION}" | tee -a $GITHUB_ENV - echo "::set-output name=VERSION::${GITHUB_VERSION}" - echo "GIT_SHA=${{ github.sha }}" | tee -a $GITHUB_ENV - echo "::set-output name=GIT_SHA::${{ github.sha }}" - else - export GITHUB_VERSION=$(curl -fsS https://raw.githubusercontent.com/infinyon/fluvio/${{ github.event.inputs.commit }}/VERSION) - echo "VERSION=${GITHUB_VERSION}" | tee -a $GITHUB_ENV - echo "::set-output name=VERSION::${GITHUB_VERSION}" - echo "GIT_SHA=${{ github.event.inputs.commit }}" | tee -a $GITHUB_ENV - echo "::set-output name=GIT_SHA::${{ github.event.inputs.commit }}" - fi - - name: Set Installer URL - id: installer_step - run: | - echo "::set-output name=INSTALLER_URL::https://raw.githubusercontent.com/infinyon/fluvio/${{ steps.version_step.outputs.GIT_SHA }}/install.sh" - - - name: Slack Notification - uses: 8398a7/action-slack@v3 - if: failure() - with: - status: ${{ job.status }} - fields: repo,message,commit,author,action,eventName,ref,workflow,job - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - MATRIX_CONTEXT: ${{ toJson(matrix) }} - - release_installer: - name: Release Fluvio Installer - needs: [setup_job] - runs-on: ubuntu-latest env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - AWS_DEFAULT_REGION: us-west-2 - TARGET_SHA: ${{ needs.setup_job.outputs.TARGET_SHA }} - INSTALLER_URL: ${{ needs.setup_job.outputs.INSTALLER_URL }} + BPKG_TOKEN: ${{ secrets.BPKG_TOKEN }} + FLUVIO_BIN: ~/.fluvio/bin/fluvio steps: - uses: actions/checkout@v4 - - name: Download install.sh - run: curl -sSO $INSTALLER_URL - - name: Push install.sh to packages S3 bucket - run: make update-public-installer-script-s3 + - name: Hotpatch + run: | + ./actions/hotpatch.sh - # Check for Github Release - release_github: - name: Release Fluvio to GitHub Release - needs: [setup_job] - runs-on: ubuntu-latest - permissions: write-all - env: - VERSION: ${{ needs.setup_job.outputs.VERSION }} - steps: - - uses: actions/checkout@v4 - # Check that this release does not already exist by trying to download it - - name: Attempt to download release by version number - id: release_check - continue-on-error: true - env: - GH_RELEASE_TAG: v${{ env.VERSION }} - run: make download-fluvio-release + # cd_dev_check: + # name: CD_Dev check + # strategy: + # fail-fast: false + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v4 + # - name: Get status of latest CD_Dev run + # id: cd_dev_check + # run: make latest-cd-dev-status + # setup_job: + # name: Setup workflow + # needs: [cd_dev_check] + # runs-on: ubuntu-latest + # outputs: + # VERSION: ${{ steps.version_step.outputs.VERSION }} + # TARGET_SHA: ${{ steps.version_step.outputs.GIT_SHA }} + # INSTALLER_URL: ${{ steps.installer_step.outputs.INSTALLER_URL }} + # steps: + # - name: Set target sha and Fluvio version + # id: version_step + # run: | + # if [[ -z "${{ github.event.inputs.commit }}" ]]; then + # export GITHUB_VERSION=$(curl -fsS https://raw.githubusercontent.com/infinyon/fluvio/${{ github.sha }}/VERSION) + # echo "VERSION=${GITHUB_VERSION}" | tee -a $GITHUB_ENV + # echo "::set-output name=VERSION::${GITHUB_VERSION}" + # echo "GIT_SHA=${{ github.sha }}" | tee -a $GITHUB_ENV + # echo "::set-output name=GIT_SHA::${{ github.sha }}" + # else + # export GITHUB_VERSION=$(curl -fsS https://raw.githubusercontent.com/infinyon/fluvio/${{ github.event.inputs.commit }}/VERSION) + # echo "VERSION=${GITHUB_VERSION}" | tee -a $GITHUB_ENV + # echo "::set-output name=VERSION::${GITHUB_VERSION}" + # echo "GIT_SHA=${{ github.event.inputs.commit }}" | tee -a $GITHUB_ENV + # echo "::set-output name=GIT_SHA::${{ github.event.inputs.commit }}" + # fi + # - name: Set Installer URL + # id: installer_step + # run: | + # echo "::set-output name=INSTALLER_URL::https://raw.githubusercontent.com/infinyon/fluvio/${{ steps.version_step.outputs.GIT_SHA }}/install.sh" - # If this release does not already exist (i.e. the release_check failed), create it - - name: Download artifacts from dev - if: ${{ steps.release_check.outcome == 'failure' }} - env: - GH_RELEASE_TAG: dev - run: make download-fluvio-release + # - name: Slack Notification + # uses: 8398a7/action-slack@v3 + # if: failure() + # with: + # status: ${{ job.status }} + # fields: repo,message,commit,author,action,eventName,ref,workflow,job + # env: + # SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + # MATRIX_CONTEXT: ${{ toJson(matrix) }} - # Release conventions expect the top-most release in CHANGELOG.md to be the version we're releasing - # The date is expected to be UNRELEASED, which we will replace with the current date - - name: Create GH Release with release notes - if: ${{ steps.release_check.outcome == 'failure' }} - env: - CHANNEL_TAG: ${{ env.VERSION }} - PRE_RELEASE: ${{ github.event.inputs.pre_release }} - run: make create-gh-release + # release_installer: + # name: Release Fluvio Installer + # needs: [setup_job] + # runs-on: ubuntu-latest + # env: + # AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + # AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + # AWS_DEFAULT_REGION: us-west-2 + # TARGET_SHA: ${{ needs.setup_job.outputs.TARGET_SHA }} + # INSTALLER_URL: ${{ needs.setup_job.outputs.INSTALLER_URL }} + # steps: + # - uses: actions/checkout@v4 + # - name: Download install.sh + # run: curl -sSO $INSTALLER_URL + # - name: Push install.sh to packages S3 bucket + # run: make update-public-installer-script-s3 - - name: Slack Notification - uses: 8398a7/action-slack@v3 - if: failure() - with: - status: ${{ job.status }} - fields: repo,message,commit,author,action,eventName,ref,workflow,job - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - MATRIX_CONTEXT: ${{ toJson(matrix) }} + # # Check for Github Release + # release_github: + # name: Release Fluvio to GitHub Release + # needs: [setup_job] + # runs-on: ubuntu-latest + # permissions: write-all + # env: + # VERSION: ${{ needs.setup_job.outputs.VERSION }} + # steps: + # - uses: actions/checkout@v4 + # # Check that this release does not already exist by trying to download it + # - name: Attempt to download release by version number + # id: release_check + # continue-on-error: true + # env: + # GH_RELEASE_TAG: v${{ env.VERSION }} + # run: make download-fluvio-release - ## Check for docker image - release_docker: - name: Release Docker Image - needs: [setup_job] - runs-on: ubuntu-latest - env: - VERSION: ${{ needs.setup_job.outputs.VERSION }} - TARGET_SHA: ${{ needs.setup_job.outputs.TARGET_SHA }} - steps: - - uses: actions/checkout@v4 - - name: Attempt to pull image tag in docker registry - id: docker_check - continue-on-error: true - env: - DOCKER_IMAGE_TAG: ${{ env.VERSION }} - run: | - make docker-hub-check-image-exists + # # If this release does not already exist (i.e. the release_check failed), create it + # - name: Download artifacts from dev + # if: ${{ steps.release_check.outcome == 'failure' }} + # env: + # GH_RELEASE_TAG: dev + # run: make download-fluvio-release - # if the check fails, then continue - - name: Tag and push release image - if: ${{ steps.docker_check.outcome == 'failure' }} - env: - DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} - DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} - DOCKER_IMAGE_TAG: ${{ env.VERSION }} - CHANNEL_TAG: stable - DEV_VERSION_TAG: ${{ env.VERSION }}-${{ env.TARGET_SHA }} - run: | - make docker-push-manifest + # # Release conventions expect the top-most release in CHANGELOG.md to be the version we're releasing + # # The date is expected to be UNRELEASED, which we will replace with the current date + # - name: Create GH Release with release notes + # if: ${{ steps.release_check.outcome == 'failure' }} + # env: + # CHANNEL_TAG: ${{ env.VERSION }} + # PRE_RELEASE: ${{ github.event.inputs.pre_release }} + # run: make create-gh-release - - name: Slack Notification - uses: 8398a7/action-slack@v3 - if: failure() - with: - status: ${{ job.status }} - fields: repo,message,commit,author,action,eventName,ref,workflow,job - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - MATRIX_CONTEXT: ${{ toJson(matrix) }} + # - name: Slack Notification + # uses: 8398a7/action-slack@v3 + # if: failure() + # with: + # status: ${{ job.status }} + # fields: repo,message,commit,author,action,eventName,ref,workflow,job + # env: + # SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + # MATRIX_CONTEXT: ${{ toJson(matrix) }} - # Check for Fluvio CLI - release_fluvio: - name: Release Fluvio CLI package - needs: [setup_job] - runs-on: ubuntu-latest - env: - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - VERSION: ${{ needs.setup_job.outputs.VERSION }} - INSTALLER_URL: ${{ needs.setup_job.outputs.INSTALLER_URL }} - BPKG_TOKEN: ${{ secrets.BPKG_TOKEN }} - steps: - - uses: actions/checkout@v4 - # Check that this release does not already exist by trying to download it - - name: Attempt to install Fluvio CLI - id: check_fluvio - continue-on-error: true - env: - CHANNEL_TAG: ${{ env.VERSION }} - run: make curl-install-fluvio + # ## Check for docker image + # release_docker: + # name: Release Docker Image + # needs: [setup_job] + # runs-on: ubuntu-latest + # env: + # VERSION: ${{ needs.setup_job.outputs.VERSION }} + # TARGET_SHA: ${{ needs.setup_job.outputs.TARGET_SHA }} + # steps: + # - uses: actions/checkout@v4 + # - name: Attempt to pull image tag in docker registry + # id: docker_check + # continue-on-error: true + # env: + # DOCKER_IMAGE_TAG: ${{ env.VERSION }} + # run: | + # make docker-hub-check-image-exists - # If this release does not already exist (i.e. check_fluvio failed), continue - - name: Install fluvio-package - env: - CHANNEL_TAG: stable # We want to ensure we install the stable version of CLI - run: | - make curl-install-fluvio - make install-fluvio-package + # # if the check fails, then continue + # - name: Tag and push release image + # if: ${{ steps.docker_check.outcome == 'failure' }} + # env: + # DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} + # DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} + # DOCKER_IMAGE_TAG: ${{ env.VERSION }} + # CHANNEL_TAG: stable + # DEV_VERSION_TAG: ${{ env.VERSION }}-${{ env.TARGET_SHA }} + # run: | + # make docker-push-manifest - - name: Download dev release - if: ${{ steps.check_fluvio.outcome == 'failure' }} - env: - GH_RELEASE_TAG: dev - run: make download-fluvio-release + # - name: Slack Notification + # uses: 8398a7/action-slack@v3 + # if: failure() + # with: + # status: ${{ job.status }} + # fields: repo,message,commit,author,action,eventName,ref,workflow,job + # env: + # SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + # MATRIX_CONTEXT: ${{ toJson(matrix) }} - - name: Publish artifacts - if: ${{ steps.check_fluvio.outcome == 'failure' }} - env: - FLUVIO_BIN: ~/.fluvio/bin/fluvio - run: | - make publish-artifacts-stable + # # Check for Fluvio CLI + # release_fluvio: + # name: Release Fluvio CLI package + # needs: [setup_job] + # runs-on: ubuntu-latest + # env: + # AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + # AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + # VERSION: ${{ needs.setup_job.outputs.VERSION }} + # INSTALLER_URL: ${{ needs.setup_job.outputs.INSTALLER_URL }} + # BPKG_TOKEN: ${{ secrets.BPKG_TOKEN }} + # steps: + # - uses: actions/checkout@v4 + # # Check that this release does not already exist by trying to download it + # - name: Attempt to install Fluvio CLI + # id: check_fluvio + # continue-on-error: true + # env: + # CHANNEL_TAG: ${{ env.VERSION }} + # run: make curl-install-fluvio - - name: Slack Notification - uses: 8398a7/action-slack@v3 - if: ${{ !success() }} - with: - status: ${{ job.status }} - fields: repo,message,commit,author,action,eventName,ref,workflow,job - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - MATRIX_CONTEXT: ${{ toJson(matrix) }} + # # If this release does not already exist (i.e. check_fluvio failed), continue + # - name: Install fluvio-package + # env: + # CHANNEL_TAG: stable # We want to ensure we install the stable version of CLI + # run: | + # make curl-install-fluvio + # make install-fluvio-package - publish_crates: - name: Publish Crates - if: ${{ !inputs.pre_release }} - uses: ./.github/workflows/publish_crates.yml - with: - commit: ${{ github.event.inputs.commit }} - secrets: inherit + # - name: Download dev release + # if: ${{ steps.check_fluvio.outcome == 'failure' }} + # env: + # GH_RELEASE_TAG: dev + # run: make download-fluvio-release - bump_stable_fluvio: - name: Bump stable Fluvio - needs: [setup_job, release_github, release_docker, release_fluvio] - #permissions: write-all - runs-on: ubuntu-latest - if: ${{ !inputs.pre_release }} - env: - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - VERSION: ${{ needs.setup_job.outputs.VERSION }} - TARGET_SHA: ${{ needs.setup_job.outputs.GIT_SHA }} - INSTALLER_URL: ${{ needs.setup_job.outputs.INSTALLER_URL }} - steps: - - uses: actions/checkout@v4 - - name: Install fluvio-package - env: - CHANNEL_TAG: stable # We want to ensure we install the stable version of CLI - run: | - if [ -n "${{ github.event.inputs.installer_version }}" ]; then - export VERSION=${{ github.event.inputs.installer_version }} - echo "VERSION=$VERSION" - fi - make curl-install-fluvio - make install-fluvio-package + # - name: Publish artifacts + # if: ${{ steps.check_fluvio.outcome == 'failure' }} + # env: + # FLUVIO_BIN: ~/.fluvio/bin/fluvio + # run: | + # make publish-artifacts-stable - - name: Bump Fluvio CLI - # This should work until we support graceful failure - continue-on-error: true - env: - BPKG_TOKEN: ${{ secrets.BPKG_TOKEN }} - run: | - make bump-fluvio-stable + # - name: Slack Notification + # uses: 8398a7/action-slack@v3 + # if: ${{ !success() }} + # with: + # status: ${{ job.status }} + # fields: repo,message,commit,author,action,eventName,ref,workflow,job + # env: + # SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + # MATRIX_CONTEXT: ${{ toJson(matrix) }} + + # publish_crates: + # name: Publish Crates + # if: ${{ !inputs.pre_release }} + # uses: ./.github/workflows/publish_crates.yml + # with: + # commit: ${{ github.event.inputs.commit }} + # secrets: inherit + + # bump_stable_fluvio: + # name: Bump stable Fluvio + # needs: [setup_job, release_github, release_docker, release_fluvio] + # #permissions: write-all + # runs-on: ubuntu-latest + # if: ${{ !inputs.pre_release }} + # env: + # AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + # AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + # VERSION: ${{ needs.setup_job.outputs.VERSION }} + # TARGET_SHA: ${{ needs.setup_job.outputs.GIT_SHA }} + # INSTALLER_URL: ${{ needs.setup_job.outputs.INSTALLER_URL }} + # steps: + # - uses: actions/checkout@v4 + # - name: Install fluvio-package + # env: + # CHANNEL_TAG: stable # We want to ensure we install the stable version of CLI + # run: | + # if [ -n "${{ github.event.inputs.installer_version }}" ]; then + # export VERSION=${{ github.event.inputs.installer_version }} + # echo "VERSION=$VERSION" + # fi + # make curl-install-fluvio + # make install-fluvio-package + + # - name: Bump Fluvio CLI + # # This should work until we support graceful failure + # continue-on-error: true + # env: + # BPKG_TOKEN: ${{ secrets.BPKG_TOKEN }} + # run: | + # make bump-fluvio-stable - - name: Slack Notification - uses: 8398a7/action-slack@v3 - if: failure() - with: - status: ${{ job.status }} - fields: repo,message,commit,author,action,eventName,ref,workflow,job - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - MATRIX_CONTEXT: ${{ toJson(matrix) }} + # - name: Slack Notification + # uses: 8398a7/action-slack@v3 + # if: failure() + # with: + # status: ${{ job.status }} + # fields: repo,message,commit,author,action,eventName,ref,workflow,job + # env: + # SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + # MATRIX_CONTEXT: ${{ toJson(matrix) }} \ No newline at end of file diff --git a/actions/hotpatch.sh b/actions/hotpatch.sh new file mode 100755 index 0000000000..f19a1d7a50 --- /dev/null +++ b/actions/hotpatch.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +export RELEASE=true +export REPO_VERSION=0.11.1 + +make curl-install-fluvio +make install-fluvio-package + +GH_RELEASE_TAG=v0.11.1 \ +make download-fluvio-release + +make publish-artifacts-stable + +make bump-fluvio-stable \ No newline at end of file