Synchronize common files from prometheus/prometheus #170
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| name: Generator | |
| on: | |
| pull_request: | |
| push: | |
| branches: [main, 'release-*'] | |
| tags: ['v*'] | |
| permissions: | |
| contents: read | |
| jobs: | |
| generator: | |
| name: Build generator | |
| runs-on: ubuntu-latest | |
| container: | |
| # Whenever the Go version is updated here, .promu.yml | |
| # should also be updated. | |
| image: quay.io/prometheus/golang-builder:1.26-base | |
| defaults: | |
| run: | |
| working-directory: ./generator | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - uses: prometheus/promci-setup@3e5cd31b34b8ae19efa8f071c5e3cdb44884a7f8 # v0.2.1 | |
| - run: apt-get update | |
| - run: apt-get -y install build-essential diffutils libsnmp-dev p7zip-full | |
| - run: make mibs | |
| - run: make generator | |
| - run: make parse_errors | |
| - run: make generate | |
| - run: git diff --exit-code | |
| - uses: prometheus/promci-artifacts/save@f9a587dbc0b2c78a0c54f8ad1cde71ea29a4b76f # v0.1.0 | |
| with: | |
| directory: generator | |
| publish_generator_main: | |
| name: Publish generator main branch artifacts | |
| runs-on: ubuntu-latest | |
| permissions: | |
| packages: write | |
| needs: [generator] | |
| defaults: | |
| run: | |
| working-directory: ./generator | |
| if: | | |
| (github.event_name == 'push' && github.event.ref == 'refs/heads/main') | |
| steps: | |
| - uses: prometheus/promci-artifacts/restore@f9a587dbc0b2c78a0c54f8ad1cde71ea29a4b76f # v0.1.0 | |
| - uses: prometheus/promci/publish_main@370e8c15dcec50043cbe66f2f34633d9efc0a190 # v0.9.0 | |
| with: | |
| docker_hub_login: ${{ secrets.docker_hub_login }} | |
| docker_hub_password: ${{ secrets.docker_hub_password }} | |
| ghcr_io_password: ${{ github.token }} | |
| quay_io_login: ${{ secrets.quay_io_login }} | |
| quay_io_password: ${{ secrets.quay_io_password }} | |
| publish_generator_release: | |
| name: Publish generator release artefacts | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| packages: write | |
| needs: [generator] | |
| defaults: | |
| run: | |
| working-directory: ./generator | |
| if: | | |
| (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')) | |
| steps: | |
| - uses: prometheus/promci-artifacts/restore@f9a587dbc0b2c78a0c54f8ad1cde71ea29a4b76f # v0.1.0 | |
| - uses: prometheus/promci/publish_release@370e8c15dcec50043cbe66f2f34633d9efc0a190 # v0.9.0 | |
| with: | |
| docker_hub_login: ${{ secrets.docker_hub_login }} | |
| docker_hub_password: ${{ secrets.docker_hub_password }} | |
| ghcr_io_password: ${{ github.token }} | |
| quay_io_login: ${{ secrets.quay_io_login }} | |
| quay_io_password: ${{ secrets.quay_io_password }} | |
| github_token: ${{ github.token }} |