Skip to content

Commit

Permalink
refactoring + actions update
Browse files Browse the repository at this point in the history
  • Loading branch information
wasilak committed Mar 2, 2023
1 parent 847acd4 commit 1c81ee7
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 711 deletions.
31 changes: 17 additions & 14 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ name: CI
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ main ]
branches: [main]
tags:
- '*'
- "*"
pull_request:
branches: [ main ]
branches: [main]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand All @@ -19,7 +19,7 @@ jobs:
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

strategy:
matrix:
os: [linux, darwin]
Expand All @@ -28,27 +28,30 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Setup Go environment
uses: actions/setup-go@v2.1.4
uses: actions/setup-go@v3
with:
go-version: 1.17
# The Go version to download (if necessary) and use. Supports semver spec and ranges.
go-version: 1.20.1
# Whether to download only stable versions
# stable: # optional, default is true
# Used to pull node distributions from go-versions. Since there's a default, this is typically not supplied by the user.
# token: # optional, default is ${{ github.token }}

- name: Build executable
run: |
mkdir -p ./dist
go build -o ./dist/consul_members_exporter
run: go build -ldflags "-X main.version=${{ github.ref_name }}" -o ./dist/consul_members_exporter
env:
GOOS: ${{ matrix.os }}
GOARCH: ${{ matrix.arch }}

- name: compress executable
run: |
cd dist
cd ./dist
chmod +x consul_members_exporter
zip consul_members_exporter-${{ matrix.os }}-${{ matrix.arch }}.zip consul_members_exporter
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
Expand Down
21 changes: 16 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,21 +1,32 @@
module github.com/wasilak/consul_members_exporter

go 1.15
go 1.20

require (
github.com/hashicorp/consul/api v1.19.1
github.com/prometheus/client_golang v1.14.0
)

require (
github.com/armon/go-metrics v0.4.1 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/fatih/color v1.14.1 // indirect
github.com/go-kit/kit v0.10.0 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/hashicorp/consul/api v1.19.1
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-hclog v1.4.0 // indirect
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
github.com/hashicorp/go-rootcerts v1.0.2 // indirect
github.com/hashicorp/golang-lru v0.5.4 // indirect
github.com/hashicorp/serf v0.10.1 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.17 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/prometheus/client_golang v1.14.0
github.com/prometheus/common v0.40.0 // indirect
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/common v0.41.0 // indirect
github.com/prometheus/procfs v0.9.0 // indirect
golang.org/x/sys v0.5.0 // indirect
google.golang.org/protobuf v1.28.1 // indirect
)
Loading

0 comments on commit 1c81ee7

Please sign in to comment.