Skip to content

Commit

Permalink
Merge pull request #6 from p2p-org/fix/ci-feat-build
Browse files Browse the repository at this point in the history
ci: fix feature branch build
  • Loading branch information
chliddle authored Jan 13, 2025
2 parents 31ff1e0 + 840dc23 commit a18f211
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
25 changes: 17 additions & 8 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ name: Build
on:
pull_request:
branches: [ main ]
paths:
- '**.go'
- 'go.mod'
- 'go.sum'

jobs:
test:
Expand All @@ -21,10 +25,9 @@ jobs:

build:
needs: test
name: Build and Publish
name: Build and Publish Package
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
Expand All @@ -46,10 +49,16 @@ jobs:
GOOS=darwin GOARCH=arm64 go build -o release/evm-exporter-darwin-arm64-${{ steps.sha.outputs.sha }} ./cmd/exporter
GOOS=windows GOARCH=amd64 go build -o release/evm-exporter-windows-amd64-${{ steps.sha.outputs.sha }}.exe ./cmd/exporter
- name: Publish to GitHub Packages
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create package archive
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
cd release && tar czf ../evm-exporter-${{ steps.sha.outputs.sha }}.tar.gz \
evm-exporter-linux-amd64-${{ steps.sha.outputs.sha }} \
evm-exporter-darwin-amd64-${{ steps.sha.outputs.sha }} \
evm-exporter-darwin-arm64-${{ steps.sha.outputs.sha }} \
evm-exporter-windows-amd64-${{ steps.sha.outputs.sha }}.exe
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: evm-exporter-${{ steps.sha.outputs.sha }}
path: evm-exporter-${{ steps.sha.outputs.sha }}.tar.gz
1 change: 1 addition & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -183,3 +183,4 @@ gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
rsc.io/tmplfunc v0.0.3 h1:53XFQh69AfOa8Tw0Jm7t+GV7KZhOi6jzsCzTtKbMvzU=
rsc.io/tmplfunc v0.0.3/go.mod h1:AG3sTPzElb1Io3Yg4voV9AGZJuleGAwaVRxL9M49PhA=

0 comments on commit a18f211

Please sign in to comment.