-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Update CI and release workflows
- Loading branch information
Showing
4 changed files
with
128 additions
and
28 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,36 @@ | ||
--- | ||
name: ci | ||
on: | ||
- push | ||
jobs: | ||
lint: | ||
name: lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
name: ci | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
jobs: | ||
lint: | ||
name: lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version: '1.22' | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v6 | ||
with: | ||
version: v1.58 | ||
test: | ||
name: test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v5 | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.22' | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v6 | ||
go-version: 1.22 | ||
- run: go test -v ./... -covermode=atomic -coverprofile=coverage.out | ||
- uses: codecov/codecov-action@v4.0.1 | ||
with: | ||
version: v1.58 | ||
test: | ||
name: test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: 1.22 | ||
- run: go test -v ./... -covermode=atomic -coverprofile=coverage.out | ||
- uses: codecov/[email protected] | ||
with: | ||
files: coverage.out | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
slug: snapp-incubator/nats-blackbox-exporter | ||
files: coverage.out | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
slug: snapp-incubator/nats-blackbox-exporter |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*.*.*' | ||
|
||
jobs: | ||
release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: '1.22' | ||
|
||
- name: Install dependencies | ||
run: go mod download | ||
|
||
- name: Install Goreleaser | ||
run: | | ||
curl -sSfL https://raw.githubusercontent.com/goreleaser/goreleaser/main/scripts/install.sh | sh | ||
- name: Run Goreleaser | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: goreleaser release --rm-dist |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,4 +20,5 @@ | |
# config | ||
config.yaml | ||
|
||
.DS_Store | ||
.DS_Store | ||
dist/ |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
project_name: nats-blackbox-exporter | ||
|
||
release: | ||
draft: true | ||
github: | ||
owner: snappcloud | ||
name: nats-blackbox-exporter | ||
|
||
name_template: 'Release {{.Tag}}' | ||
|
||
builds: | ||
- main: ./cmd/nats-blackbox-exporter | ||
id: nats-blackbox-exporter | ||
binary: nats-blackbox-exporter | ||
ldflags: | ||
- "-s -w -X github.com/nats-io/nats-blackbox-exporter/cmd.Version={{ .Tag }}" | ||
env: | ||
- GO111MODULE=on | ||
- CGO_ENABLED=0 | ||
goos: | ||
- linux | ||
- darwin | ||
- windows | ||
goarch: | ||
- 386 | ||
- amd64 | ||
- arm | ||
- arm64 | ||
goarm: | ||
- 6 | ||
- 7 | ||
ignore: | ||
- goos: darwin | ||
goarch: 386 | ||
|
||
archives: | ||
- id: zipfiles | ||
wrap_in_directory: true | ||
name_template: '{{ .ProjectName }}-v{{ .Version }}-{{ .Os }}-{{ .Arch }}{{ if .Arm | ||
}}v{{ .Arm }}{{ end }}' | ||
format: zip | ||
files: | ||
- LICENSE | ||
- README.md | ||
- nats-blackbox-exporter* | ||
|
||
nfpms: | ||
- formats: | ||
- deb | ||
file_name_template: '{{ .ProjectName }}-v{{ .Version }}-{{ .Os }}-{{ .Arch }}{{ if .Arm | ||
}}v{{ .Arm }}{{ end }}' | ||
bindir: /usr/local/bin | ||
description: A Simplified Prometheus Monitoring Solution for NATS | ||
vendor: nats.io | ||
maintainer: Colin Sullivan <[email protected]> | ||
homepage: https://nats.io | ||
license: Apache 2.0 | ||
|
||
snapshot: | ||
name_template: SNAPSHOT-{{ .Commit }} | ||
|
||
checksum: | ||
name_template: '{{ .ProjectName }}-v{{ .Version }}-checksums.txt' |