Skip to content

Commit 59c86e6

Browse files
Merge branch 'master' into feature/auto-discovery-for-directory-services
2 parents d287301 + 2ee4901 commit 59c86e6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+705
-715
lines changed

.github/workflows/ci.yml

Lines changed: 79 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,54 @@
1-
name: Go
1+
name: CI
22

33
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
branches:
8+
- master
49
pull_request:
510
workflow_call:
611

712
jobs:
813
build:
9-
name: Build
14+
name: Build for common architectures
1015
runs-on: ubuntu-latest
11-
container:
12-
image: quay.io/prometheus/golang-builder:1.23-base
16+
if: |
17+
!(github.event_name == 'push' && github.event.ref == 'refs/heads/master')
18+
&&
19+
!(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v'))
20+
strategy:
21+
matrix:
22+
thread: [ 0, 1, 2 ]
1323
steps:
1424
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1525
- uses: prometheus/promci@52c7012f5f0070d7281b8db4a119e21341d43c91 # v0.4.5
16-
- uses: ./.github/promci/actions/setup_environment
17-
- run: make
18-
- run: git diff --exit-code
26+
- uses: ./.github/promci/actions/build
27+
with:
28+
promu_opts: "-p linux/amd64 -p windows/amd64 -p darwin/amd64 -p linux/arm64 -p windows/arm64 -p darwin/arm64"
29+
parallelism: 3
30+
thread: ${{ matrix.thread }}
31+
32+
build_all:
33+
name: Build for all architectures
34+
runs-on: ubuntu-latest
35+
if: |
36+
(github.event_name == 'push' && github.event.ref == 'refs/heads/master')
37+
||
38+
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v'))
39+
strategy:
40+
matrix:
41+
thread: [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 ]
42+
steps:
43+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
44+
- uses: prometheus/promci@52c7012f5f0070d7281b8db4a119e21341d43c91 # v0.4.5
45+
- uses: ./.github/promci/actions/build
46+
with:
47+
parallelism: 12
48+
thread: ${{ matrix.thread }}
1949

2050
verify-example-configs:
21-
name: verify
51+
name: Verify
2252
runs-on: ubuntu-latest
2353
container:
2454
image: quay.io/prometheus/golang-builder:1.23-base
@@ -27,3 +57,44 @@ jobs:
2757
- run: make build
2858
- name: Verify example configs
2959
run: find ./examples -name "*.yml" -print0 | xargs -0 -I % ./yace verify-config -config.file %
60+
61+
publish_master:
62+
name: Publish master branch artifacts
63+
runs-on: ubuntu-latest
64+
needs: [build_all, verify-example-configs]
65+
if: |
66+
(github.repository == 'prometheus-community/yet-another-cloudwatch-exporter')
67+
&&
68+
(github.event_name == 'push' && github.event.ref == 'refs/heads/master')
69+
steps:
70+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
71+
- uses: prometheus/promci@52c7012f5f0070d7281b8db4a119e21341d43c91 # v0.4.5
72+
- uses: ./.github/promci/actions/publish_main
73+
with:
74+
docker_hub_organization: prometheuscommunity
75+
docker_hub_login: ${{ secrets.docker_hub_login }}
76+
docker_hub_password: ${{ secrets.docker_hub_password }}
77+
quay_io_organization: prometheuscommunity
78+
quay_io_login: ${{ secrets.quay_io_login }}
79+
quay_io_password: ${{ secrets.quay_io_password }}
80+
81+
publish_release:
82+
name: Publish release artifacts
83+
runs-on: ubuntu-latest
84+
needs: [build_all, verify-example-configs]
85+
if: |
86+
(github.repository == 'prometheus-community/yet-another-cloudwatch-exporter')
87+
&&
88+
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v0.'))
89+
steps:
90+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
91+
- uses: prometheus/promci@52c7012f5f0070d7281b8db4a119e21341d43c91 # v0.4.5
92+
- uses: ./.github/promci/actions/publish_release
93+
with:
94+
docker_hub_organization: prometheuscommunity
95+
docker_hub_login: ${{ secrets.docker_hub_login }}
96+
docker_hub_password: ${{ secrets.docker_hub_password }}
97+
quay_io_organization: prometheuscommunity
98+
quay_io_login: ${{ secrets.quay_io_login }}
99+
quay_io_password: ${{ secrets.quay_io_password }}
100+
github_token: ${{ secrets.PROMBOT_GITHUB_TOKEN }}

.github/workflows/golangci-lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- name: Checkout repository
2727
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2828
- name: Install Go
29-
uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
29+
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
3030
with:
3131
go-version: 1.23.x
3232
- name: Install snmp_exporter/generator dependencies

.github/workflows/push.yml

Lines changed: 0 additions & 18 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 0 additions & 26 deletions
This file was deleted.

.golangci.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,8 @@ linters:
3131
- typecheck
3232
- unconvert
3333
- unused
34+
- sloglint
3435

3536
linters-settings:
36-
errcheck:
37-
exclude-functions:
38-
- (github.com/go-kit/log.Logger).Log
3937
goimports:
4038
local-prefixes: "github.com/prometheus-community/yet-another-cloudwatch-exporter"

0 commit comments

Comments
 (0)