remove glibc dependencies #5
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
name: Build | |
on: | |
pull_request: | |
branches: [ main ] | |
jobs: | |
test: | |
name: test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.21' | |
- name: test | |
run: go test -v ./... | |
build: | |
needs: test | |
name: Build and Publish | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.21' | |
- name: Get short SHA | |
id: sha | |
run: echo "sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | |
- name: Build binaries | |
run: | | |
mkdir -p release | |
GOOS=linux GOARCH=amd64 go build -tags "netgo osusergo" -o release/evm-exporter-linux-amd64-${{ steps.sha.outputs.sha }} ./cmd/exporter | |
GOOS=darwin GOARCH=amd64 go build -tags "netgo osusergo" -o release/evm-exporter-darwin-amd64-${{ steps.sha.outputs.sha }} ./cmd/exporter | |
GOOS=darwin GOARCH=arm64 go build -tags "netgo osusergo" -o release/evm-exporter-darwin-arm64-${{ steps.sha.outputs.sha }} ./cmd/exporter | |
GOOS=windows GOARCH=amd64 go build -tags "netgo osusergo" -o release/evm-exporter-windows-amd64-${{ steps.sha.outputs.sha }}.exe ./cmd/exporter | |
- name: Publish to GitHub Packages | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
for file in release/*; do | |
gh release upload "commit-${{ steps.sha.outputs.sha }}" "$file" --clobber || gh release create "commit-${{ steps.sha.outputs.sha }}" "$file" | |
done |