Skip to content

Commit e575e9f

Browse files
committed
Update for prometheus-community
* Add missing license headers. * Update Go build. * Switch to promu for releasing. Signed-off-by: SuperQ <[email protected]>
1 parent 1b15617 commit e575e9f

38 files changed

+775
-162
lines changed

.github/dependabot.yml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "gomod"
4+
directory: "/"
5+
schedule:
6+
interval: "monthly"

.github/workflows/build.yml

+6-15
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
name: build
22

33
on:
4-
push:
5-
branches: [ master ]
6-
pull_request:
7-
branches: [ master ]
4+
pull_request
85

96
jobs:
107

@@ -13,20 +10,14 @@ jobs:
1310
runs-on: ubuntu-latest
1411
steps:
1512

16-
- name: Set up Go 1.22
17-
uses: actions/setup-go@v4
13+
- name: Set up Go
14+
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
1815
with:
19-
go-version: 1.22
16+
go-version: 1.23
2017
id: go
2118

2219
- name: Check out code into the Go module directory
23-
uses: actions/checkout@v4
24-
25-
- name: Get dependencies
26-
run: go get -v -t -d ./...
20+
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
2721

2822
- name: Build
29-
run: go build -v .
30-
31-
- name: Test
32-
run: go test -v ./...
23+
run: make

.github/workflows/golangci-lint.yml

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
# This action is synced from https://github.com/prometheus/prometheus
3+
name: golangci-lint
4+
on:
5+
push:
6+
paths:
7+
- "go.sum"
8+
- "go.mod"
9+
- "**.go"
10+
- "scripts/errcheck_excludes.txt"
11+
- ".github/workflows/golangci-lint.yml"
12+
- ".golangci.yml"
13+
pull_request:
14+
15+
permissions: # added using https://github.com/step-security/secure-repo
16+
contents: read
17+
18+
jobs:
19+
golangci:
20+
permissions:
21+
contents: read # for actions/checkout to fetch code
22+
pull-requests: read # for golangci/golangci-lint-action to fetch pull requests
23+
name: lint
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Checkout repository
27+
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
28+
- name: Install Go
29+
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
30+
with:
31+
go-version: 1.23.x
32+
- name: Install snmp_exporter/generator dependencies
33+
run: sudo apt-get update && sudo apt-get -y install libsnmp-dev
34+
if: github.repository == 'prometheus/snmp_exporter'
35+
- name: Lint
36+
uses: golangci/golangci-lint-action@aaa42aa0628b4ae2578232a66b541047968fac86 # v6.1.0
37+
with:
38+
args: --verbose
39+
version: v1.60.2

.github/workflows/release.yml

-31
This file was deleted.

.goreleaser.yml

-48
This file was deleted.

.promu.yml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
go:
2+
# This must match .github/workflows/build.yml.
3+
version: 1.23
4+
repository:
5+
path: github.com/prometheus-community/rsyslog_exporter
6+
build:
7+
binaries:
8+
- name: rsyslog_exporter
9+
ldflags: |
10+
-X github.com/prometheus/common/version.Version={{.Version}}
11+
-X github.com/prometheus/common/version.Revision={{.Revision}}
12+
-X github.com/prometheus/common/version.Branch={{.Branch}}
13+
-X github.com/prometheus/common/version.BuildUser={{user}}@{{host}}
14+
-X github.com/prometheus/common/version.BuildDate={{date "20060102-15:04:05"}}
15+
tarball:
16+
files:
17+
- LICENSE
18+
- NOTICE

Makefile

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Copyright 2024 The Prometheus Authors
2+
# Licensed under the Apache License, Version 2.0 (the "License");
3+
# you may not use this file except in compliance with the License.
4+
# You may obtain a copy of the License at
5+
#
6+
# http://www.apache.org/licenses/LICENSE-2.0
7+
#
8+
# Unless required by applicable law or agreed to in writing, software
9+
# distributed under the License is distributed on an "AS IS" BASIS,
10+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
# See the License for the specific language governing permissions and
12+
# limitations under the License.
13+
14+
# Needs to be defined before including Makefile.common to auto-generate targets
15+
DOCKER_ARCHS ?= amd64 armv7 arm64
16+
DOCKER_REPO ?= prometheuscommunity
17+
18+
include Makefile.common
19+
20+
STATICCHECK_IGNORE =
21+
22+
DOCKER_IMAGE_NAME ?= rsyslog-exporter

0 commit comments

Comments
 (0)