Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Synchronize common files from prometheus/prometheus #1636

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/container_description.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: ''
32 changes: 16 additions & 16 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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\

Expand All @@ -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' }}
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading