Skip to content

Commit

Permalink
Update build
Browse files Browse the repository at this point in the history
* Update Go to 1.20.
* Use goreleaser CI orb.
* Update minimum Go version to 1.19.
* Update golangci-lint action.

Signed-off-by: SuperQ <superq@gmail.com>
  • Loading branch information
SuperQ committed Apr 4, 2023
1 parent 8ae78da commit e92b3a1
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 25 deletions.
38 changes: 18 additions & 20 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
---
version: 2.1

orbs:
goreleaser: hubci/goreleaser@2.3.0

executors:
golang:
docker:
- image: cimg/go:1.19
- image: cimg/go:1.20

jobs:
build:
Expand All @@ -13,33 +16,28 @@ jobs:
- checkout
- run: go mod download
- run: make
- run: cd /tmp && curl -L --remote-name https://github.com/goreleaser/goreleaser/releases/download/v1.8.3/goreleaser_Linux_x86_64.tar.gz
- run: cd /tmp && curl -L --remote-name https://github.com/goreleaser/goreleaser/releases/download/v1.8.3/checksums.txt
- run: cd /tmp && sha256sum --ignore-missing -c checksums.txt
- run: mkdir -p /home/circleci/.local/bin
- run: tar -C /home/circleci/.local/bin -xf /tmp/goreleaser_Linux_x86_64.tar.gz goreleaser
- run: goreleaser release --skip-publish --snapshot --debug
- store_artifacts:
path: dist

release:
executor: golang

steps:
- checkout
- run: go mod download
- run: curl -sfL https://install.goreleaser.com/github.com/goreleaser/goreleaser.sh | BINDIR=/home/circleci/.local/bin sh
- run: goreleaser release

workflows:
version: 2
stuff:
pro-bing:
jobs:
- build:
filters:
tags:
only: /.*/
- release:
- goreleaser/release:
name: test-release
version: '1.16.2'
go-version: '1.20'
requires:
- build
filters:
tags:
only: /.*/
- goreleaser/release:
name: release
version: '1.16.2'
go-version: '1.20'
requires:
- build
filters:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3
- name: install Go
uses: actions/setup-go@v2
uses: actions/setup-go@v3
with:
go-version: 1.19.x
go-version: 1.20.x
- name: Install snmp_exporter/generator dependencies
run: sudo apt-get update && sudo apt-get -y install libsnmp-dev
if: github.repository == 'prometheus/snmp_exporter'
- name: Lint
uses: golangci/golangci-lint-action@v3.2.0
uses: golangci/golangci-lint-action@v3.4.0
with:
version: v1.49.0
version: v1.51.2
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/prometheus-community/pro-bing

go 1.18
go 1.19

require (
github.com/google/uuid v1.3.0
Expand Down

0 comments on commit e92b3a1

Please sign in to comment.