Skip to content

Commit

Permalink
ci: use goreleaser to publish binaries on tags (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
anitgandhi committed Jul 15, 2024
1 parent 68c387d commit 4131d6f
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.22.4"
go-version: "1.22.5"

- name: Install Linters
run: |
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: release

on:
push:
tags:
- v[0-9]+\.[0-9]+\.[0-9]+.*

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout Project
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.22.5"

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
with:
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GORELEASER_GITHUB_TOKEN }}
21 changes: 21 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json

version: 2

env:
- CGO_ENABLED=0

builds:
- id: "ebpf_exporter"
main: "./cmd/ebpf_exporter/"
binary: "ebpf_exporter"
flags:
- "-trimpath"
ldflags: "-s -w"
goos:
- "linux"
goarch:
- "amd64"
- "386"
- "arm"
- "arm64"

0 comments on commit 4131d6f

Please sign in to comment.