Merge pull request #402 from perses/fix-cel-validation #6
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: ci | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - release/* | |
| - snapshot/* | |
| tags: | |
| - v* | |
| pull_request: | |
| merge_group: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: ${{ github.event_name == 'pull_request' || github.ref_name != 'main' }} | |
| jobs: | |
| build: | |
| name: "go and github release" | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| env: | |
| # This env is required for the docker manifest command to work | |
| DOCKER_CLI_EXPERIMENTAL: "enabled" | |
| # This env is required for the bundle-build command to work | |
| CONTAINER_RUNTIME: "docker" | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - uses: perses/github-actions@v0.12.0 | |
| - uses: ./.github/perses-ci/actions/setup_environment | |
| with: | |
| enable_go: true | |
| - name: Install all tools | |
| uses: ./.github/tools-cache | |
| - # Add support for more platforms with QEMU (optional) | |
| # https://github.com/docker/setup-qemu-action | |
| name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v3 | |
| if: ${{ github.event_name == 'push' && (startsWith(github.ref_name, 'v') || github.ref_name == 'main') }} | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Login to Quay.io | |
| uses: docker/login-action@v3 | |
| if: ${{ github.event_name == 'push' && (startsWith(github.ref_name, 'v') || github.ref_name == 'main') }} | |
| with: | |
| registry: quay.io | |
| username: ${{ secrets.QUAY_USERNAME }} | |
| password: ${{ secrets.QUAY_TOKEN }} | |
| - name: install goreleaser | |
| uses: goreleaser/goreleaser-action@v7 | |
| with: | |
| distribution: goreleaser | |
| install-only: true | |
| - name: Build main Go binaries and docker images | |
| run: | | |
| make cross-build | |
| BUNDLE_IMG=docker.io/persesdev/perses-operator-bundle:$(make -s print-image-tag) make bundle-build | |
| BUNDLE_IMG=quay.io/persesdev/perses-operator-bundle:$(make -s print-image-tag) make bundle-build | |
| - name: Push main branch images | |
| ## This step will run when main branch is pushed. | |
| ## It will push docker images with 'main' tag and git SHA tag | |
| if: ${{ github.event_name == 'push' && github.ref_name == 'main' }} | |
| run: | | |
| make push-main-docker-image | |
| BUNDLE_IMG=docker.io/persesdev/perses-operator-bundle:$(make -s print-image-tag) make bundle-push | |
| BUNDLE_IMG=quay.io/persesdev/perses-operator-bundle:$(make -s print-image-tag) make bundle-push | |
| - name: Publish Release and binaries | |
| ## This step will only run when a new tag is pushed. | |
| ## It will build the Go binaries and the docker images and then publish: | |
| ## - the GitHub release with the archive built | |
| ## - docker images on the different docker registry selected | |
| if: ${{ github.event_name == 'push' && startsWith(github.ref_name, 'v') }} | |
| run: | | |
| make cross-release | |
| BUNDLE_IMG=docker.io/persesdev/perses-operator-bundle:v$(cat VERSION) make bundle-build bundle-push | |
| BUNDLE_IMG=quay.io/persesdev/perses-operator-bundle:v$(cat VERSION) make bundle-build bundle-push | |
| CATALOG_IMG=docker.io/persesdev/perses-operator-catalog:v$(cat VERSION) make catalog-build catalog-push | |
| CATALOG_IMG=quay.io/persesdev/perses-operator-catalog:v$(cat VERSION) make catalog-build catalog-push | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |