Skip to content

Release Images

Release Images #20

Workflow file for this run

name: Release Images
on:
schedule:
- cron: '0 0 * * 1-5' # Runs at 00:00 UTC on Mon to Friday
workflow_dispatch:
inputs:
release_version:
description: 'The release version of image'
required: false
default: 'latest'
dockerfile:
description: 'release specify Dockerfile or empty to release all images'
required: false
default: ''
type: choice
options:
- ""
- Dockerfile
- Dockerfile-charts
- Dockerfile-dataprotection
- Dockerfile-dev
- Dockerfile-tools
- Dockerfile-ubi
release:
types:
- published
env:
GH_TOKEN: ${{ github.token }}
RELEASE_VERSION: ${{ github.ref_name }}
jobs:
release-version:
runs-on: ubuntu-latest
outputs:
release-version: ${{ steps.get_release_version.outputs.release_version }}
release-version-bump: ${{ steps.get_release_version.outputs.release_version_bump }}
git-commit: ${{ steps.get_git_info.outputs.git_commit }}
git-version: ${{ steps.get_git_info.outputs.git_version }}
steps:
- uses: actions/checkout@v4
- name: Get Release Version
id: get_release_version
run: |
RELEASE_VERSION="latest"
if [[ ! -z "${{ inputs.release_version }}" ]]; then
RELEASE_VERSION="${{ inputs.release_version }}"
elif [[ "${{ env.RELEASE_VERSION }}" == "main" ]]; then
RELEASE_VERSION="latest"
elif [[ ! -z "${{ env.RELEASE_VERSION }}" ]]; then
RELEASE_VERSION=${{ env.RELEASE_VERSION }}
fi
echo release_version=$RELEASE_VERSION >> $GITHUB_OUTPUT
RELEASE_VERSION_BUMP="${RELEASE_VERSION/v/}"
echo release_version_bump=$RELEASE_VERSION_BUMP >> $GITHUB_OUTPUT
- name: get git info
id: get_git_info
run: |
GIT_COMMIT=$(git rev-list -1 HEAD)
GIT_VERSION=$(git describe --always --abbrev=0 --tag)
echo git_commit=$GIT_COMMIT >> $GITHUB_OUTPUT
echo git_version=$GIT_VERSION >> $GITHUB_OUTPUT
release-image:

Check failure on line 66 in .github/workflows/release-image.yml

View workflow run for this annotation

GitHub Actions / Release Images

Invalid workflow file

The workflow is not valid. .github/workflows/release-image.yml (Line: 66, Col: 3): Error calling workflow 'apecloud/apecloud-cd/.github/workflows/release-image-cache.yml@v0.1.64'. The nested job 'release-image' is requesting 'id-token: write', but is only allowed 'id-token: none'.
if: ${{ inputs.dockerfile == '' || inputs.dockerfile == 'Dockerfile' }}
needs: release-version
uses: apecloud/apecloud-cd/.github/workflows/release-image-cache.yml@v0.1.64
with:
MAKE_OPS_PRE: "generate"
IMG: "apecloud/kubeblocks"
VERSION: "${{ needs.release-version.outputs.release-version }}"
GO_VERSION: "1.24"
APECD_REF: "v0.1.24"
DOCKERFILE_PATH: "./docker/Dockerfile"
BUILDX_ARGS: |
VERSION=${{ needs.release-version.outputs.release-version }}
GIT_COMMIT=${{ needs.release-version.outputs.git-commit }}
GIT_VERSION=${{ needs.release-version.outputs.git-version }}
secrets: inherit
release-tools-image:
if: ${{ inputs.dockerfile == '' || inputs.dockerfile == 'Dockerfile-tools' }}
needs: release-version
uses: apecloud/apecloud-cd/.github/workflows/release-image-no-cache.yml@v0.1.91
with:
MAKE_OPS_PRE: "module generate test-go-generate"
IMG: "apecloud/kubeblocks-tools"
VERSION: "${{ needs.release-version.outputs.release-version }}"
GO_VERSION: "1.24"
APECD_REF: "v0.1.24"
DOCKERFILE_PATH: "./docker/Dockerfile-tools"
secrets: inherit
release-dataprotection-image:
if: ${{ inputs.dockerfile == '' || inputs.dockerfile == 'Dockerfile-dataprotection' }}
needs: release-version
uses: apecloud/apecloud-cd/.github/workflows/release-image-cache.yml@v0.1.24
with:
IMG: "apecloud/kubeblocks-dataprotection"
VERSION: "${{ needs.release-version.outputs.release-version }}"
APECD_REF: "v0.1.24"
DOCKERFILE_PATH: "./docker/Dockerfile-dataprotection"
secrets: inherit
release-charts-image:
if: ${{ github.event_name == 'workflow_dispatch' && (inputs.dockerfile == '' || inputs.dockerfile == 'Dockerfile-charts') }}
needs: release-version
uses: apecloud/apecloud-cd/.github/workflows/release-image-cache.yml@v0.1.24
with:
MAKE_OPS_PRE: "helm-package VERSION=${{ needs.release-version.outputs.release-version-bump }}"
IMG: "apecloud/kubeblocks-charts"
VERSION: "${{ needs.release-version.outputs.release-version }}"
GO_VERSION: "1.24"
APECD_REF: "v0.1.24"
DOCKERFILE_PATH: "./docker/Dockerfile-charts"
secrets: inherit
release-dev-image:
if: ${{ github.event_name == 'workflow_dispatch' && (inputs.dockerfile == '' || inputs.dockerfile == 'Dockerfile-dev') }}
needs: release-version
uses: apecloud/apecloud-cd/.github/workflows/release-image-cache.yml@v0.1.24
with:
IMG: "apecloud/kubeblocks-dev"
VERSION: "${{ needs.release-version.outputs.release-version }}"
APECD_REF: "v0.1.24"
DOCKERFILE_PATH: "./docker/Dockerfile-dev"
CONTEXT: "./docker"
secrets: inherit
release-redhat-image:
if: ${{ github.event_name == 'workflow_dispatch' && (inputs.dockerfile == '' || inputs.dockerfile == 'Dockerfile-ubi') }}
needs: release-version
uses: apecloud/apecloud-cd/.github/workflows/release-image-cache.yml@v0.1.64
with:
MAKE_OPS_PRE: "generate"
IMG: "apecloud/kubeblocks"
VERSION: "${{ needs.release-version.outputs.release-version }}-ubi"
GO_VERSION: "1.24"
APECD_REF: "v0.1.64"
DOCKERFILE_PATH: "./docker/Dockerfile-ubi"
BUILDX_ARGS: |
VERSION=${{ needs.release-version.outputs.release-version }}
GIT_COMMIT=${{ needs.release-version.outputs.git-commit }}
GIT_VERSION=${{ needs.release-version.outputs.git-version }}
secrets: inherit
release-message:
runs-on: ubuntu-latest
needs: [ release-image, release-tools-image, release-dataprotection-image ]
outputs:
content-result: ${{ steps.release_message.outputs.content_result }}
release-version: ${{ steps.release_message.outputs.release_version }}
if: ${{ always() && github.event.action == 'published' }}
steps:
- uses: actions/checkout@v4
- name: release message
id: release_message
run: |
ARTIFACT_KEY="${{ env.RELEASE_VERSION }}-image"
touch ${ARTIFACT_KEY}
echo 'artifact_key='${ARTIFACT_KEY} >> $GITHUB_OUTPUT
CONTENT="error"
if [[ "${{ needs.release-image.result }}" == "success" && "${{ needs.release-tools-image.result }}" == "success" && "${{ needs.release-dataprotection-image.result }}" == "success" ]]; then
CONTENT="success"
echo "success" > ${ARTIFACT_KEY}
else
echo "error" > ${ARTIFACT_KEY}
fi
echo 'content_result='$CONTENT >> $GITHUB_OUTPUT
echo release_version=${{ env.RELEASE_VERSION }} >> $GITHUB_OUTPUT
- name: delete cache
continue-on-error: true
run: |
bash .github/utils/utils.sh --type 17 --tag-name "${{ steps.release_message.outputs.artifact_key }}"
- name: Save Artifact
id: cache-artifact-save
uses: actions/cache/save@v3
with:
path: |
${{ steps.release_message.outputs.artifact_key }}
key: ${{ steps.release_message.outputs.artifact_key }}
send-message:
needs: [ release-message ]
if: ${{ always() && github.event.action == 'published' }}
uses: apecloud/apecloud-cd/.github/workflows/feishui-message.yml@v0.1.38
with:
TYPE: "2"
CONTENT: "release image ${{ needs.release-message.outputs.release-version }} ${{ needs.release-message.outputs.content-result }}"
APECD_REF: "v0.1.38"
secrets: inherit