Fix when multiple label names normalize to the same string #228
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: CI | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - "**" | |
| tags: | |
| - "v*" | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| name: Maven build | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 | |
| with: | |
| persist-credentials: false | |
| - name: Set up JDK 25 | |
| uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0 | |
| with: | |
| java-version: "25" | |
| distribution: temurin | |
| cache: maven | |
| - name: Check formatting | |
| run: mvn -B fmt:check --file pom.xml | |
| - name: Build | |
| run: mvn -B package --file pom.xml | |
| - name: Update dependency graph | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/master' | |
| uses: advanced-security/maven-dependency-submission-action@b275d12641ac2d2108b2cbb7598b154ad2f2cee8 # v5.0.0 | |
| build_image: | |
| name: Build container image | |
| runs-on: ubuntu-latest | |
| needs: build | |
| if: | | |
| github.event_name == 'pull_request' | |
| || | |
| ( | |
| github.event_name == 'push' | |
| && | |
| github.ref != 'refs/heads/master' | |
| && | |
| !startsWith(github.ref, 'refs/tags/') | |
| ) | |
| env: | |
| BUILDX_PLATFORMS: linux/amd64,linux/arm64 | |
| steps: | |
| - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 | |
| with: | |
| persist-credentials: false | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@06116385d9baf250c9f4dcb4858b16962ea869c3 # v4.1.0 | |
| - name: Set up Buildx | |
| uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 # v4.1.0 | |
| - name: Build image | |
| run: | | |
| docker buildx build \ | |
| --progress plain \ | |
| --platform "$BUILDX_PLATFORMS" \ | |
| . | |
| publish_image: | |
| name: Publish container image | |
| runs-on: ubuntu-latest | |
| needs: build | |
| if: | | |
| github.repository_owner == 'prometheus' | |
| && | |
| github.event_name == 'push' | |
| && | |
| ( | |
| github.ref == 'refs/heads/master' | |
| || | |
| startsWith(github.ref, 'refs/tags/v') | |
| ) | |
| env: | |
| BUILDX_PLATFORMS: linux/amd64,linux/arm64 | |
| steps: | |
| - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 | |
| with: | |
| persist-credentials: false | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@06116385d9baf250c9f4dcb4858b16962ea869c3 # v4.1.0 | |
| - name: Set up Buildx | |
| uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 # v4.1.0 | |
| - name: Login to quay.io | |
| uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4.2.0 | |
| with: | |
| registry: quay.io | |
| username: ${{ secrets.QUAY_IO_LOGIN }} | |
| password: ${{ secrets.QUAY_IO_PASSWORD }} | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4.2.0 | |
| with: | |
| username: ${{ secrets.DOCKER_HUB_LOGIN }} | |
| password: ${{ secrets.DOCKER_HUB_PASSWORD }} | |
| - name: Build and push image | |
| run: | | |
| tags=(master) | |
| if [[ "$GITHUB_REF_TYPE" == "tag" ]]; then | |
| tags+=(latest) | |
| fi | |
| docker buildx build \ | |
| --progress plain \ | |
| --platform "$BUILDX_PLATFORMS" \ | |
| "${tags[@]/#/--tag=quay.io/prometheus/cloudwatch-exporter:}" \ | |
| "${tags[@]/#/--tag=prom/cloudwatch-exporter:}" \ | |
| --push . | |
| - name: List images | |
| run: docker images |