Skip to content

Commit

Permalink
Merge branch 'master' into pablo/add-aws-transfer
Browse files Browse the repository at this point in the history
  • Loading branch information
cristiangreco authored Jan 9, 2025
2 parents 0446f12 + 8f8a564 commit 8588477
Show file tree
Hide file tree
Showing 68 changed files with 701 additions and 715 deletions.
87 changes: 79 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,54 @@
name: Go
name: CI

on:
push:
tags:
- 'v*'
branches:
- master
pull_request:
workflow_call:

jobs:
build:
name: Build
name: Build for common architectures
runs-on: ubuntu-latest
container:
image: quay.io/prometheus/golang-builder:1.23-base
if: |
!(github.event_name == 'push' && github.event.ref == 'refs/heads/master')
&&
!(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v'))
strategy:
matrix:
thread: [ 0, 1, 2 ]
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: prometheus/promci@52c7012f5f0070d7281b8db4a119e21341d43c91 # v0.4.5
- uses: ./.github/promci/actions/setup_environment
- run: make
- run: git diff --exit-code
- uses: ./.github/promci/actions/build
with:
promu_opts: "-p linux/amd64 -p windows/amd64 -p darwin/amd64 -p linux/arm64 -p windows/arm64 -p darwin/arm64"
parallelism: 3
thread: ${{ matrix.thread }}

build_all:
name: Build for all architectures
runs-on: ubuntu-latest
if: |
(github.event_name == 'push' && github.event.ref == 'refs/heads/master')
||
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v'))
strategy:
matrix:
thread: [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 ]
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: prometheus/promci@52c7012f5f0070d7281b8db4a119e21341d43c91 # v0.4.5
- uses: ./.github/promci/actions/build
with:
parallelism: 12
thread: ${{ matrix.thread }}

verify-example-configs:
name: verify
name: Verify
runs-on: ubuntu-latest
container:
image: quay.io/prometheus/golang-builder:1.23-base
Expand All @@ -27,3 +57,44 @@ jobs:
- run: make build
- name: Verify example configs
run: find ./examples -name "*.yml" -print0 | xargs -0 -I % ./yace verify-config -config.file %

publish_master:
name: Publish master branch artifacts
runs-on: ubuntu-latest
needs: [build_all, verify-example-configs]
if: |
(github.repository == 'prometheus-community/yet-another-cloudwatch-exporter')
&&
(github.event_name == 'push' && github.event.ref == 'refs/heads/master')
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: prometheus/promci@52c7012f5f0070d7281b8db4a119e21341d43c91 # v0.4.5
- uses: ./.github/promci/actions/publish_main
with:
docker_hub_organization: prometheuscommunity
docker_hub_login: ${{ secrets.docker_hub_login }}
docker_hub_password: ${{ secrets.docker_hub_password }}
quay_io_organization: prometheuscommunity
quay_io_login: ${{ secrets.quay_io_login }}
quay_io_password: ${{ secrets.quay_io_password }}

publish_release:
name: Publish release artifacts
runs-on: ubuntu-latest
needs: [build_all, verify-example-configs]
if: |
(github.repository == 'prometheus-community/yet-another-cloudwatch-exporter')
&&
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v0.'))
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: prometheus/promci@52c7012f5f0070d7281b8db4a119e21341d43c91 # v0.4.5
- uses: ./.github/promci/actions/publish_release
with:
docker_hub_organization: prometheuscommunity
docker_hub_login: ${{ secrets.docker_hub_login }}
docker_hub_password: ${{ secrets.docker_hub_password }}
quay_io_organization: prometheuscommunity
quay_io_login: ${{ secrets.quay_io_login }}
quay_io_password: ${{ secrets.quay_io_password }}
github_token: ${{ secrets.PROMBOT_GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Install Go
uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
with:
go-version: 1.23.x
- name: Install snmp_exporter/generator dependencies
Expand Down
18 changes: 0 additions & 18 deletions .github/workflows/push.yml

This file was deleted.

26 changes: 0 additions & 26 deletions .github/workflows/release.yml

This file was deleted.

4 changes: 1 addition & 3 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,8 @@ linters:
- typecheck
- unconvert
- unused
- sloglint

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

0 comments on commit 8588477

Please sign in to comment.