chore: change support K8s version list #135
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release EMQX Operator | |
concurrency: | |
group: ${{ github.ref }} | |
cancel-in-progress: true | |
on: | |
push: | |
tags: | |
- "*" | |
workflow_dispatch: | |
inputs: | |
tag: | |
description: 'Ref to release' | |
required: true | |
default: HEAD | |
env: | |
GIT_TAG: ${{ github.event_name == 'push' && github.ref || inputs.tag }} | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ env.GIT_TAG }} | |
- name: Check helm | |
if: github.event_name == 'push' | |
run: | | |
version=$(grep -E "^version" deploy/charts/emqx-operator/Chart.yaml | grep -oE "[0-9]+\.[0-9]+\.[0-9]+(-(alpha|beta|rc)\.[0-9])?") | |
if [ "$version" != "${GITHUB_REF##*/}" ]; then | |
echo "Need update version for Chart.yaml" | |
exit 1 | |
fi | |
appVersion=$(grep -E "^appVersion" deploy/charts/emqx-operator/Chart.yaml | grep -oE "[0-9]+\.[0-9]+\.[0-9]+(-(alpha|beta|rc)\.[0-9])?") | |
if [ "$appVersion" != "${GITHUB_REF##*/}" ]; then | |
echo "Need update appVersion for Chart.yaml" | |
exit 1 | |
fi | |
- uses: docker/setup-qemu-action@v3 | |
- uses: docker/setup-buildx-action@v3 | |
- uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ github.token }} | |
- uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_HUB_USER }} | |
password: ${{ secrets.DOCKER_HUB_TOKEN }} | |
- uses: docker/metadata-action@v5 | |
id: meta | |
with: | |
images: | | |
${{ github.repository_owner }}/emqx-operator-controller | |
ghcr.io/${{ github.repository_owner }}/emqx-operator | |
tags: | | |
type=ref,event=branch | |
type=ref,event=pr | |
type=ref,event=tag | |
type=semver,pattern={{version}},value=${{ env.GIT_TAG }} | |
type=semver,pattern={{major}}.{{minor}},value=${{ env.GIT_TAG }} | |
- uses: docker/build-push-action@v5 | |
with: | |
platforms: linux/amd64,linux/arm64,linux/arm/v7 | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
context: . | |
- uses: peter-evans/dockerhub-description@v3 | |
with: | |
username: ${{ secrets.DOCKER_HUB_USER }} | |
password: ${{ secrets.DOCKER_HUB_TOKEN }} | |
repository: "${{ github.repository_owner }}/emqx-operator-controller" | |
readme-filepath: ./README.md | |
short-description: "EMQX Operator creates and manages EMQX clusters running in Kubernetes." | |
- id: prerelease | |
run: | | |
if echo "${{ github.ref_name }}" |egrep -q "^[0-9]+.[0-9]+.[0-9]+$"; then | |
echo "::set-output name=prerelease::false" | |
else | |
echo "::set-output name=prerelease::true" | |
fi | |
- uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: ${{ env.GIT_TAG }} | |
prerelease: ${{ steps.prerelease.outputs.prerelease }} | |
generate_release_notes: true | |
## When you use the repository's GITHUB_TOKEN to perform tasks, | |
## events triggered by the GITHUB_TOKEN, with the exception of workflow_dispatch and repository_dispatch, | |
## will not create a new workflow run. | |
## This prevents you from accidentally creating recursive workflow runs. | |
## More info: https://docs.github.com/en/actions/using-workflows/triggering-a-workflow#triggering-a-workflow-from-a-workflow | |
# token: ${{ github.token }} | |
token: ${{ secrets.CI_GIT_TOKEN }} | |
name: EMQX Operator ${{ github.ref_name }} Released | |
body_path: RELEASE.md |