diff --git a/.github/workflows/container_description.yml b/.github/workflows/container_description.yml index a6e6ce32b..8ddbc34ae 100644 --- a/.github/workflows/container_description.yml +++ b/.github/workflows/container_description.yml @@ -33,3 +33,25 @@ jobs: # Empty string results in README-containers.md being pushed if it # exists. Otherwise, README.md is pushed. readme_file: '' + + PushQuayIoReadme: + runs-on: ubuntu-latest + name: Push README to quay.io + if: github.repository_owner == 'prometheus' || github.repository_owner == 'prometheus-community' # Don't run this workflow on forks. + steps: + - name: git checkout + uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 + - name: Set quay.io org name + run: echo "DOCKER_REPO=$(echo quay.io/${GITHUB_REPOSITORY_OWNER} | tr -d '-')" >> $GITHUB_ENV + - name: Set quay.io repo name + run: echo "DOCKER_REPO_NAME=$(make docker-repo-name)" >> $GITHUB_ENV + - name: Push README to quay.io + uses: christian-korneck/update-container-description-action@d36005551adeaba9698d8d67a296bd16fa91f8e8 # v1 + env: + DOCKER_APIKEY: ${{ secrets.QUAY_IO_API_TOKEN }} + with: + destination_container_repo: ${{ env.DOCKER_REPO_NAME }} + provider: quay + # Empty string results in README-containers.md being pushed if it + # exists. Otherwise, README.md is pushed. + readme_file: '' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 87055671e..6bcef6370 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -44,7 +44,7 @@ jobs: run: | curl.exe -L https://github.com/moby/buildkit/releases/download/v${{ env.VERSION_BUILDKIT }}/buildkit-v${{ env.VERSION_BUILDKIT }}.windows-amd64.tar.gz -o buildkit.tar.gz tar.exe xvf buildkit.tar.gz - + .\bin\buildkitd.exe --register-service Start-Service buildkitd - name: Setup Docker Buildx @@ -75,32 +75,32 @@ jobs: - name: Build run: | $ErrorActionPreference = "Stop" - + $Version = git describe --tags --always $Version = $Version -replace 'v', '' # '+' symbols are invalid characters in image tags $Version = $Version -replace '\+', '_' $Version | Set-Content VERSION -PassThru - + make build-all - + # GH requires all files to have different names, so add version/arch to differentiate foreach($Arch in "amd64", "arm64") { Move-Item output\$Arch\windows_exporter.exe output\windows_exporter-$Version-$Arch.exe } - + Get-ChildItem -Path output - name: Build Release Artifacts run: | $ErrorActionPreference = "Stop" $Version = Get-Content VERSION - + foreach($Arch in "amd64", "arm64") { Write-Host "Building windows_exporter $Version msi for $Arch" .\installer\build.ps1 -PathToExecutable .\output\windows_exporter-$Version-$Arch.exe -Version $Version -Arch "$Arch" } - + Move-Item installer\*.msi output\ Get-ChildItem -Path output\ @@ -119,26 +119,26 @@ jobs: env: VERSION: >- ${{ - startsWith(github.ref, 'refs/tags/') && 'latest' || + startsWith(github.ref, 'refs/tags/') && 'latest' || ( github.event_name == 'pull_request' && format('pr-{0}', github.event.number) || github.ref_name ) }} - name: Login to Docker Hub - if: ${{ github.event_name != 'pull_request' }} + #if: ${{ github.event_name != 'pull_request' }} uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_HUB_LOGIN }} password: ${{ secrets.DOCKER_HUB_PASSWORD }} - #- name: Login to quay.io - # if: ${{ github.event_name != 'pull_request' }} - # uses: docker/login-action@v3 - # with: - # registry: quay.io - # username: 'robot' - # password: ${{ secrets.QUAY_IO_API_TOKEN }} + - name: Login to quay.io + #if: ${{ github.event_name != 'pull_request' }} + uses: docker/login-action@v3 + with: + registry: quay.io + username: ${{ secrets.quay_io_login }} + password: ${{ secrets.quay_io_password }} - name: Login to GitHub container registry if: ${{ github.event_name != 'pull_request' }} diff --git a/Makefile b/Makefile index 0e55f4d86..21019d9cf 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ DOCKER_REPO ?= prometheuscommunity DOCKER_IMAGE_NAME ?= windows-exporter # ALL_DOCKER_REPOS is the list of repositories to push the image to. ghcr.io requires that org name be the same as the image repo name. -ALL_DOCKER_REPOS ?= docker.io/$(DOCKER_REPO) ghcr.io/prometheus-community # quay.io/$(DOCKER_REPO) +ALL_DOCKER_REPOS ?= docker.io/$(DOCKER_REPO) ghcr.io/prometheus-community quay.io/$(DOCKER_REPO) # Image Variables for host process Container # Windows image build is heavily influenced by https://github.com/kubernetes/kubernetes/blob/master/cluster/images/etcd/Makefile