Skip to content

Commit

Permalink
Add ARM64 pipeline (#213)
Browse files Browse the repository at this point in the history
  • Loading branch information
kuskoman authored Jan 8, 2024
1 parent c9a9ac7 commit d1997be
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
30 changes: 29 additions & 1 deletion .github/workflows/go-application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ on:
push:
branches:
- master
- v1
tags:
- "*"
pull_request:
branches:
- master
- v1

env:
TAG_NAME: "${GITHUB_REF##*/}"
Expand Down Expand Up @@ -162,6 +164,31 @@ jobs:
name: logstash-exporter-linux
path: out/main-linux

build-linux-arm:
name: Build Linux ARM binary
runs-on: ubuntu-20.04
needs: [lint, test]
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Golang with cache
uses: magnetikonline/action-golang-cache@v4
with:
go-version: "^1.21"

- name: Build Linux ARM binary
run: make build-linux-arm
env:
VERSION: ${{ github.ref }}

- name: Upload Linux ARM binary
uses: actions/upload-artifact@v3
with:
name: logstash-exporter-linux-arm
path: out/main-linux-arm

build-darwin:
name: Build Mac binary
runs-on: ubuntu-20.04
Expand Down Expand Up @@ -369,13 +396,14 @@ jobs:
upload-binaries:
strategy:
matrix:
binary: [linux, darwin, windows]
binary: [linux, darwin, windows, linux-arm]
runs-on: ubuntu-20.04
needs:
- create-release
- build-linux
- build-darwin
- build-windows
- build-linux-arm
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Download binary
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ build-linux: out/main-linux
build-darwin: out/main-darwin
#: Builds a binary executable for Windows
build-windows: out/main-windows
#: Builds a binary executable for Linux ARM
build-linux-arm:
CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=7 go build -a -installsuffix cgo -ldflags="$(ldflags)" -o out/main-linux-arm cmd/exporter/main.go

#: Builds a Docker image for the Go Exporter application
build-docker:
Expand Down

0 comments on commit d1997be

Please sign in to comment.