Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

workflows: enable arm64 and darwin binary builds #132

Merged
merged 1 commit into from
Apr 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions .github/workflows/builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ jobs:
build_cli:
name: Build CLI
runs-on: ubuntu-22.04
strategy:
matrix:
os: [ linux, darwin ]
arch: [ amd64, arm64 ]

steps:
- uses: actions/checkout@v4
Expand All @@ -51,21 +55,21 @@ jobs:
run: if [[ $(make version) == *"dirty"* ]]; then exit 1; fi

- name: Build CLI
run: make
run: GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} make

- name: Rename CLI binary
run: mv ./bin/neo-exporter* ./bin/neo-exporter-linux-amd64
run: mv ./bin/neo-exporter* ./bin/neo-exporter-${{ matrix.os }}-${{ matrix.arch }}${{ (matrix.os == 'windows' && '.exe') || '' }}

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: neo-exporter
name: neo-exporter-${{ matrix.os }}-${{ matrix.arch }}
path: ./bin/neo-exporter*
if-no-files-found: error

- name: Attach binary to the release as an asset
if: ${{ github.event_name == 'release' }}
run: gh release upload ${{ github.event.release.tag_name }} ./bin/neo-exporter-linux-amd64
run: gh release upload ${{ github.event.release.tag_name }} ./bin/neo-exporter-${{ matrix.os }}-${{ matrix.arch }}${{ (matrix.os == 'windows' && '.exe') || '' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down
Loading