Merge pull request #1191 from emqx/fix/ds/parse-spillover #2
Workflow file for this run
This file contains hidden or 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 Operator | |
| on: | |
| push: | |
| tags: | |
| - '[0-9]+.[0-9]*' | |
| workflow_dispatch: | |
| inputs: | |
| branch: | |
| description: 'Branch to build from (e.g., main-2.3)' | |
| required: true | |
| default: main-2.3 | |
| tag: | |
| description: 'Operator tag (e.g. 2.3.0). Empty = dry run.' | |
| required: false | |
| permissions: | |
| contents: write | |
| packages: write | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| env: | |
| RELEASE_VERSION: ${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.ref_name }} | |
| RELEASE_IMAGE: ghcr.io/${{ github.repository_owner }}/emqx-operator | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ (github.event_name == 'workflow_dispatch' && inputs.branch) || github.ref }} | |
| - 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/metadata-action@v5 | |
| id: metadata | |
| with: | |
| images: ${{ env.RELEASE_IMAGE }} | |
| tags: | | |
| type=ref,event=branch | |
| type=semver,pattern={{version}},value=${{ env.RELEASE_VERSION }} | |
| type=semver,pattern={{major}}.{{minor}},value=${{ env.RELEASE_VERSION }} | |
| - uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| file: ./Dockerfile | |
| platforms: linux/amd64,linux/arm64 | |
| push: ${{ (github.event_name == 'push' && github.ref_type == 'tag') || (github.event_name == 'workflow_dispatch' && inputs.tag != '') }} | |
| tags: ${{ steps.metadata.outputs.tags }} | |
| labels: ${{ steps.metadata.outputs.labels }} | |
| provenance: false | |
| - name: Build installer | |
| run: | | |
| make build-installer OPERATOR_IMAGE=${{ env.RELEASE_IMAGE }}:${{ env.RELEASE_VERSION || format('{0}-{1}', github.ref_name, github.sha) }} | |
| - name: Create GitHub Release | |
| if: ${{ (github.event_name == 'push' && github.ref_type == 'tag') || (github.event_name == 'workflow_dispatch' && inputs.tag != '') }} | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| gh release create "${RELEASE_VERSION}" \ | |
| dist/install.yaml \ | |
| --title "EMQX Operator ${RELEASE_VERSION}" \ | |
| --generate-notes \ | |
| --verify-tag \ | |
| --draft |