Skip to content

Commit 5cfc1de

Browse files
committed
Update build
* Update Go to 1.26.x. * Migrate to GitHub Actions. * Enable dependabot for GitHub Actions. Signed-off-by: SuperQ <superq@gmail.com>
1 parent 9149b89 commit 5cfc1de

File tree

4 files changed

+128
-43
lines changed

4 files changed

+128
-43
lines changed

.circleci/config.yml

Lines changed: 19 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,33 @@
11
---
2+
# Prometheus has switched to GitHub action.
3+
# Circle CI is not disabled repository-wise so that previous pull requests
4+
# continue working.
5+
# This file does not generate any CircleCI workflow.
6+
27
version: 2.1
3-
orbs:
4-
prometheus: prometheus/prometheus@0.17.1
8+
59
executors:
6-
# Whenever the Go version is updated here, .promu.yml should
7-
# also be updated.
810
golang:
911
docker:
10-
- image: quay.io/prometheus/golang-builder:1.25-base
12+
- image: busybox
13+
1114
jobs:
12-
test:
15+
noopjob:
1316
executor: golang
17+
1418
steps:
15-
- prometheus/setup_environment
16-
- run: make
17-
- prometheus/store_artifact:
18-
file: prom-label-proxy
19-
- store_test_results:
20-
path: test-results
19+
- run:
20+
command: "true"
21+
2122
workflows:
2223
version: 2
2324
prom-label-proxy:
2425
jobs:
25-
- test:
26+
- noopjob
27+
triggers:
28+
- schedule:
29+
cron: "0 0 30 2 *"
2630
filters:
27-
tags:
28-
only: /.*/
29-
- prometheus/build:
30-
name: build
31-
filters:
32-
tags:
33-
only: /.*/
34-
- prometheus/publish_main:
35-
docker_hub_organization: "" # Don't publish to DockerHub.
36-
quay_io_organization: prometheuscommunity
37-
requires:
38-
- test
39-
- build
40-
filters:
41-
branches:
42-
only: main
43-
- prometheus/publish_release:
44-
docker_hub_organization: "" # Don't publish to DockerHub.
45-
quay_io_organization: prometheuscommunity
46-
requires:
47-
- test
48-
- build
49-
filters:
50-
tags:
51-
only: /^v.*/
5231
branches:
53-
ignore: /.*/
32+
only:
33+
- main

.github/dependabot.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
version: 2
22
updates:
3-
- package-ecosystem: "gomod"
4-
directory: "/"
3+
- package-ecosystem: gomod
4+
directory: /
55
schedule:
6-
interval: "weekly"
6+
interval: monthly
7+
open-pull-requests-limit: 10
8+
- package-ecosystem: github-actions
9+
directory: /
10+
schedule:
11+
interval: monthly
12+
open-pull-requests-limit: 10
13+
# Exclude configs synced from upstream prometheus/prometheus.
14+
exclude-paths:
15+
- .github/workflows/container_description.yml
16+
- .github/workflows/golangci-lint.yml

.github/workflows/ci.yml

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
branches:
8+
- master
9+
pull_request:
10+
workflow_call:
11+
12+
jobs:
13+
test_go:
14+
name: Go tests
15+
runs-on: ubuntu-latest
16+
container:
17+
image: quay.io/prometheus/golang-builder:1.26-base
18+
steps:
19+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
20+
- uses: prometheus/promci-setup@5af30ba8c199a91d6c04ebdc3c48e630e355f62d # v0.1.0
21+
- run: make
22+
23+
build:
24+
name: Build for common architectures
25+
runs-on: ubuntu-latest
26+
if: |
27+
!(github.event_name == 'push' && github.event.ref == 'refs/heads/master')
28+
&&
29+
!(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v'))
30+
strategy:
31+
matrix:
32+
thread: [ 0, 1, 2 ]
33+
steps:
34+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
35+
- uses: prometheus/promci/build@769ee18070cd21cfc2a24fa912349fd3e48dee58 # v0.6.0
36+
with:
37+
promu_opts: "-p linux/amd64 -p windows/amd64 -p darwin/amd64 -p linux/arm64 -p windows/arm64 -p darwin/arm64"
38+
parallelism: 3
39+
thread: ${{ matrix.thread }}
40+
41+
build_all:
42+
name: Build for all architectures
43+
runs-on: ubuntu-latest
44+
if: |
45+
(github.event_name == 'push' && github.event.ref == 'refs/heads/master')
46+
||
47+
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v'))
48+
strategy:
49+
matrix:
50+
thread: [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 ]
51+
steps:
52+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
53+
- uses: prometheus/promci/build@769ee18070cd21cfc2a24fa912349fd3e48dee58 # v0.6.0
54+
with:
55+
parallelism: 12
56+
thread: ${{ matrix.thread }}
57+
58+
publish_master:
59+
name: Publish master branch artifacts
60+
runs-on: ubuntu-latest
61+
needs: [test_go, build_all]
62+
if: |
63+
(github.repository == 'prometheus-community/prom-label-proxy')
64+
&&
65+
(github.event_name == 'push' && github.event.ref == 'refs/heads/master')
66+
steps:
67+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
68+
- uses: prometheus/promci/publish_main@769ee18070cd21cfc2a24fa912349fd3e48dee58 # v0.6.0
69+
with:
70+
docker_hub_organization: prometheuscommunity
71+
docker_hub_login: ${{ secrets.docker_hub_login }}
72+
docker_hub_password: ${{ secrets.docker_hub_password }}
73+
quay_io_organization: prometheuscommunity
74+
quay_io_login: ${{ secrets.quay_io_login }}
75+
quay_io_password: ${{ secrets.quay_io_password }}
76+
77+
publish_release:
78+
name: Publish release artifacts
79+
runs-on: ubuntu-latest
80+
needs: [test_go, build_all]
81+
if: |
82+
(github.repository == 'prometheus-community/prom-label-proxy')
83+
&&
84+
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v0.'))
85+
steps:
86+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
87+
- uses: prometheus/promci/publish_release@769ee18070cd21cfc2a24fa912349fd3e48dee58 # v0.6.0
88+
with:
89+
docker_hub_organization: prometheuscommunity
90+
docker_hub_login: ${{ secrets.docker_hub_login }}
91+
docker_hub_password: ${{ secrets.docker_hub_password }}
92+
quay_io_organization: prometheuscommunity
93+
quay_io_login: ${{ secrets.quay_io_login }}
94+
quay_io_password: ${{ secrets.quay_io_password }}
95+
github_token: ${{ secrets.PROMBOT_GITHUB_TOKEN }}

.promu.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
go:
33
# This must match .circle/config.yml.
4-
version: 1.25
4+
version: 1.26
55
repository:
66
path: github.com/prometheus-community/prom-label-proxy
77
build:

0 commit comments

Comments
 (0)