Skip to content

Commit

Permalink
fixes for ARM build
Browse files Browse the repository at this point in the history
  • Loading branch information
AnalogJ committed Sep 29, 2020
1 parent 95e5a5e commit 94559d2
Showing 1 changed file with 18 additions and 10 deletions.
28 changes: 18 additions & 10 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Build
- name: Test
env:
GOOS: linux
GOARCH: amd64
Expand All @@ -22,24 +22,32 @@ jobs:
cd $PROJECT_PATH
go mod vendor
go test -race -coverprofile=coverage.txt -covermode=atomic -v -tags "static" $(go list ./... | grep -v /vendor/)
GOOS=linux GOARCH=amd64 go build -ldflags "-X main.goos=linux -X main.goarch=amd64" -o scrutiny-web-linux-amd64 -tags "static" webapp/backend/cmd/scrutiny/scrutiny.go
GOOS=linux GOARCH=amd64 go build -ldflags "-X main.goos=linux -X main.goarch=amd64" -o scrutiny-collector-metrics-linux-amd64 -tags "static" collector/cmd/collector-metrics/collector-metrics.go
GOOS=linux GOARCH=arm64 go build -ldflags "-X main.goos=linux -X main.goarch=arm64" -o scrutiny-web-linux-arm64 -tags "static" webapp/backend/cmd/scrutiny/scrutiny.go
GOOS=linux GOARCH=arm64 go build -ldflags "-X main.goos=linux -X main.goarch=arm64" -o scrutiny-collector-metrics-linux-arm64 -tags "static" collector/cmd/collector-metrics/collector-metrics.go
- name: Build amd64
env:
GOOS: linux
GOARCH: amd64
run: |
go build -ldflags "-X main.goos=linux -X main.goarch=amd64" -o scrutiny-web-linux-amd64 -tags "static" webapp/backend/cmd/scrutiny/scrutiny.go
go build -ldflags "-X main.goos=linux -X main.goarch=amd64" -o scrutiny-collector-metrics-linux-amd64 -tags "static" collector/cmd/collector-metrics/collector-metrics.go
chmod +x scrutiny-web-linux-amd64
chmod +x scrutiny-collector-metrics-linux-amd64
chmod +x scrutiny-web-linux-arm64
chmod +x scrutiny-collector-metrics-linux-arm64
# print info about the static binaries
file scrutiny-web-linux-amd64
file scrutiny-collector-metrics-linux-amd64
- name: Build arm64
env:
GOOS: linux
GOARCH: arm64
run: |
go build -ldflags "-X main.goos=linux -X main.goarch=arm64" -o scrutiny-web-linux-arm64 -tags "static" webapp/backend/cmd/scrutiny/scrutiny.go
go build -ldflags "-X main.goos=linux -X main.goarch=arm64" -o scrutiny-collector-metrics-linux-arm64 -tags "static" collector/cmd/collector-metrics/collector-metrics.go
chmod +x scrutiny-web-linux-arm64
chmod +x scrutiny-collector-metrics-linux-arm64
- name: Archive
uses: actions/upload-artifact@v2
Expand Down

4 comments on commit 94559d2

@Zorlin
Copy link
Contributor

@Zorlin Zorlin commented on 94559d2 Oct 3, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yay!

is it possible to also get arm 32-bit builds?

@AnalogJ
Copy link
Owner Author

@AnalogJ AnalogJ commented on 94559d2 Oct 3, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @Zorlin I just added Arm(32) builds to the CI: 46d0473

If you're interested in testing it out, you can download the binaries.zip file from the CI here: https://github.com/AnalogJ/scrutiny/actions/runs/285389324
You'll need to extract the file, chmod +x scrutiny-collector-metrics-linux-arm, and then run it via the manual install instructions

If you could respond to this issue with the results of your testing (either success & failure), that would fantastic, since this is a brand new binary.

@Zorlin
Copy link
Contributor

@Zorlin Zorlin commented on 94559d2 Oct 3, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent! As promised, I just became a GitHub Sponsor for you ;)

I'll have a poke later tonight and check it out, and once it hits releases I'll also update the Ansible playbook.

@AnalogJ
Copy link
Owner Author

@AnalogJ AnalogJ commented on 94559d2 Oct 3, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh wow, thanks for that! I appreciate all the work you've done on the ansible playbook as well :)

Please sign in to comment.