-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
55 additions
and
41 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,59 +1,24 @@ | ||
name: CI | ||
name: test-collector | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- v.* | ||
- 'main' | ||
|
||
permissions: | ||
contents: write | ||
packages: write | ||
|
||
jobs: | ||
test: | ||
test-collector: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Fetch all tags | ||
run: git fetch --force --tags | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v3 | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: 1.19 | ||
|
||
- name: Test collector | ||
run: go test -exec sudo -v ./collector/ | ||
|
||
goreleaser: | ||
runs-on: ubuntu-latest | ||
needs: [test] | ||
if: contains(github.ref, 'refs/tags/v') | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Fetch all tags | ||
run: git fetch --force --tags | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.19 | ||
|
||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v2 | ||
with: | ||
distribution: goreleaser | ||
version: latest | ||
args: release --rm-dist | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: go test -v -exec sudo ./collector/ |
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,48 @@ | ||
name: relase-tags | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
|
||
permissions: | ||
contents: write | ||
packages: write | ||
|
||
jobs: | ||
test-collector: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: 1.19 | ||
|
||
- name: Test collector | ||
run: go test -v -exec sudo ./collector/ | ||
|
||
goreleaser: | ||
runs-on: ubuntu-latest | ||
needs: [test-collector] | ||
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/v') | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: 1.19 | ||
|
||
- name: Fetch all tags | ||
run: git fetch --force --tags | ||
|
||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v4 | ||
with: | ||
distribution: goreleaser | ||
version: latest | ||
args: release --rm-dist | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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 |
---|---|---|
|
@@ -13,6 +13,7 @@ builds: | |
- linux | ||
goarch: | ||
- amd64 | ||
- arm64 | ||
main: ./cmd/tc_exporter | ||
archives: | ||
- id: arch | ||
|
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,6 +1,6 @@ | ||
module github.com/fbegyn/tc_exporter | ||
|
||
go 1.20 | ||
go 1.19 | ||
|
||
require ( | ||
github.com/florianl/go-tc v0.4.2 | ||
|