Skip to content

Commit

Permalink
add .goreleaser.yml
Browse files Browse the repository at this point in the history
update help text
updade release.yml action's versions
  • Loading branch information
Silvio Fragata da Silva committed Mar 8, 2024
1 parent 2b74edd commit d78c937
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 14 deletions.
18 changes: 5 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,19 @@ jobs:
steps:
-
name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0
-
name: Set up Go
uses: actions/setup-go@v2
uses: actions/setup-go@v5
with:
go-version: 1.17
go-version: 1.22
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
uses: goreleaser/goreleaser-action@v5
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.sfragata }}
-
name: trigger docker image builder
run: |
curl --location --request POST 'https://api.github.com/repos/sfragata/docker/dispatches' \
--header 'Accept: application/vnd.github.everest-preview+json' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer ${{secrets.REPOSITORY_DISPATCH_TOKEN}}' \
--data-raw '{ "event_type": "plex_exporter", "client_payload": { "image_version": "${{ github.event.release.tag_name }}" } }'
GITHUB_TOKEN: ${{ secrets.RELEASE }}
51 changes: 51 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# This is an example goreleaser.yaml file with some sane defaults.
# Make sure to check the documentation at http://goreleaser.com
before:
hooks:
# You may remove this if you don't use go modules.
- go mod download
# you may remove this if you don't need go generate
# - go generate ./...
builds:
- env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
ldflags: -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}}
archives:
- format_overrides:
- goos: windows
format: zip
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ .Tag }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'

brews:
-
# Name template of the recipe
# Default to project name
name: adguardhome_exporter

tap:
owner: sfragata
name: homebrew-tap

# Your app's homepage.
# Default is empty.
homepage: 'https://github.com/sfragata/adguardhome_exporter/'

# Your app's description.
# Default is empty.
description: 'Prometheus adguardhome exporter'
commit_author:
name: sfragata
email: sfragata@gmail.com
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func main() {
flaggy.Int(&adguardPort, "p", "port", "Adguard home port")

var adguardToken = os.Getenv("ADGUARD_HOME_TOKEN") // username:password in base64
flaggy.String(&adguardToken, "t", "token", "Adguard home token (if ADGUARD_HOME_TOKEN env variable is set, don't need to pass it)")
flaggy.String(&adguardToken, "t", "token", "Adguard home token (if ADGUARD_HOME_TOKEN env variable is set, don't need to pass it). username:password in base64 format")

var metricsPort = "9311"
flaggy.String(&metricsPort, "l", "listen-address", "Adguard home exporter metrics port")
Expand Down

0 comments on commit d78c937

Please sign in to comment.