From f9f04dca2b169e48abc9637ee33acc72443f4f38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Fri, 23 Feb 2024 20:18:14 +0100 Subject: [PATCH] gha: release: Update the workflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The release workflow is now updated to be a `workflow_call`, and it includes the steps that had to be manually done in the past, such as updating the needed files and creating the release itself. While on this, the kata-deploy multiarch manifest tags have been updated to match the new release scheme. Signed-off-by: Fabiano FidĂȘncio --- .github/workflows/release.yaml | 42 ++++++++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 10 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index bfe6202728..e54c356f2b 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,14 +1,37 @@ -name: Publish Kata release artifacts +name: Release Kata Containers on: - push: - tags: - - '[0-9]+.[0-9]+.[0-9]+*' - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true + workflow_call: + inputs: + release-type: + required: true + type: string jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Get the new release version + run: | + release_version=$(./tools/packaging/release/release.sh next-release-version) + echo "RELEASE_VERSION=$release_version" >> "$GITHUB_ENV" + env: + RELEASE_TYPE: ${{ inputs.release-type }} + + - name: Update VERSION file + run: | + ./tools/packaging/release/release.sh update-version-file + + - name: Create a new release + run: | + ./tools/packaging/release/release.sh create-new-release + env: + GH_TOKEN: ${{ github.token }} + build-and-push-assets-amd64: uses: ./.github/workflows/release-amd64.yaml with: @@ -55,8 +78,7 @@ jobs: - name: Push multi-arch manifest run: | - tags="$(echo $GITHUB_REF | cut -d/ -f3-)" - tags+=" $([[ \"${tag}\" =~ \"alpha\"|\"rc\" ]] && echo \"latest\" || echo \"stable\"))" + tags="$(cat VERSION) latest" echo "KATA_DEPLOY_IMAGE_TAGS=\"${tags}\"" >> "$GITHUB_ENV" ./tools/packaging/release/release.sh publish-multiarch-manifest