diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 87055671..6bcef637 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 0e55f4d8..21019d9c 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