mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-02-08 05:56:37 +00:00
Add HostProcess Container Configuration for k8s
Co-authored-by: Brian Redmond <brianisrunning@gmail.com> Signed-off-by: Brian Redmond <brianisrunning@gmail.com> Signed-off-by: James Sturtevant <jstur@microsoft.com>
This commit is contained in:
committed by
James Sturtevant
parent
e07b2053af
commit
b450a50103
28
.github/workflows/ci.yml
vendored
28
.github/workflows/ci.yml
vendored
@@ -11,6 +11,10 @@ on:
|
||||
- published
|
||||
- edited
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: windows-2019
|
||||
@@ -34,7 +38,7 @@ jobs:
|
||||
run: make e2e-test
|
||||
|
||||
lint:
|
||||
runs-on: windows-2019
|
||||
runs-on: windows-2022
|
||||
steps:
|
||||
# `gofmt` linter run by golangci-lint fails on CRLF line endings (the default for Windows)
|
||||
- name: Set git to use LF
|
||||
@@ -73,7 +77,7 @@ jobs:
|
||||
ignore_words_list: calle
|
||||
|
||||
build:
|
||||
runs-on: windows-2019
|
||||
runs-on: windows-2022
|
||||
needs:
|
||||
- test
|
||||
- lint
|
||||
@@ -90,6 +94,7 @@ jobs:
|
||||
|
||||
- name: Install Build deps
|
||||
run: |
|
||||
dotnet tool install --global GitVersion.Tool --version 5.*
|
||||
go get github.com/prometheus/promu@v0.11.1
|
||||
go get github.com/josephspurrier/goversioninfo/cmd/goversioninfo@v1.2.0
|
||||
# GOPATH\bin dir must be added to PATH else the `promu` and `goversioninfo` commands won't be found
|
||||
@@ -99,13 +104,14 @@ jobs:
|
||||
run: |
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
gitversion /output json /showvariable FullSemVer | Set-Content VERSION -PassThru
|
||||
dotnet-gitversion /output json /showvariable FullSemVer | Set-Content VERSION -PassThru
|
||||
$Version = Get-Content VERSION
|
||||
# Windows versioninfo resources need the file version by parts (but product version is free text)
|
||||
$VersionParts = ($Version -replace '^v?([0-9\.]+).*$','$1').Split(".")
|
||||
goversioninfo.exe -ver-major $VersionParts[0] -ver-minor $VersionParts[1] -ver-patch $VersionParts[2] -product-version $Version -platform-specific
|
||||
|
||||
make crossbuild
|
||||
make build-all
|
||||
# GH requires all files to have different names, so add version/arch to differentiate
|
||||
foreach($Arch in "amd64","386") {
|
||||
Move-Item output\$Arch\windows_exporter.exe output\windows_exporter-$Version-$Arch.exe
|
||||
@@ -133,6 +139,21 @@ jobs:
|
||||
|
||||
promu checksum output\
|
||||
|
||||
- name: Login to GitHub container registry
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Push Latest image
|
||||
if: ${{ github.event_name != 'pull_request' }}
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
VERSION=latest make push-all
|
||||
|
||||
- name: Release
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
env:
|
||||
@@ -140,3 +161,4 @@ jobs:
|
||||
run: |
|
||||
$TagName = $env:GITHUB_REF -replace 'refs/tags/', ''
|
||||
Get-ChildItem -Path output\* -Include @('windows_exporter*.msi', 'windows_exporter*.exe', 'sha256sums.txt') | Foreach-Object {gh release upload $TagName $_}
|
||||
make push-all
|
||||
|
||||
Reference in New Issue
Block a user