Build universal macOS binaries for Orbit (#6208)

This commit is contained in:
Zach Wasserman 2022-06-13 15:43:47 -07:00 committed by GitHub
parent ed4ae18602
commit 12d915531e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 31 additions and 5 deletions

View File

@ -45,7 +45,7 @@ jobs:
go-version: 1.18.2
- name: Run GoReleaser
run: go run github.com/goreleaser/goreleaser@v1.1.0 release --rm-dist -f orbit/.goreleaser.yml
run: go run github.com/goreleaser/goreleaser@v1.9.2 release --rm-dist -f orbit/.goreleaser.yml
env:
AC_USERNAME: ${{ secrets.APPLE_USERNAME }}
AC_PASSWORD: ${{ secrets.APPLE_PASSWORD }}

View File

@ -1,6 +1,6 @@
# Use default credentials from environment
notarize {
path = "./dist/orbit_darwin_amd64.zip"
path = "./dist/orbit-macos_darwin_all.zip"
bundle_id = "com.fleetdm.orbit"
}

View File

@ -11,7 +11,6 @@ builds:
env:
- CGO_ENABLED=0
goos:
- darwin
- linux
- windows
goarch:
@ -22,9 +21,30 @@ builds:
- -X github.com/fleetdm/fleet/v4/orbit/pkg/build.Version={{.Version}}
- -X github.com/fleetdm/fleet/v4/orbit/pkg/build.Commit={{.Commit}}
- -X github.com/fleetdm/fleet/v4/orbit/pkg/build.Date={{.Date}}
- id: orbit-macos
dir: ./orbit/cmd/orbit/
binary: orbit
env:
- CGO_ENABLED=0
goos:
- darwin
goarch:
- amd64
- arm64
flags:
- -trimpath
ldflags:
- -X github.com/fleetdm/fleet/v4/orbit/pkg/build.Version={{.Version}}
- -X github.com/fleetdm/fleet/v4/orbit/pkg/build.Commit={{.Commit}}
- -X github.com/fleetdm/fleet/v4/orbit/pkg/build.Date={{.Date}}
universal_binaries:
- replace: true
id: orbit-macos
hooks:
post: ./orbit/tools/build/sign-macos.sh {{ .Path }}
archives:
- id: orbit
builds:
@ -36,6 +56,11 @@ archives:
- goos: windows
format: zip
- id: orbit-macos
builds:
- orbit-macos
name_template: orbit_{{.Version}}_macos
checksum:
name_template: 'checksums.txt'

View File

@ -0,0 +1 @@
* Orbit is now a Universal Binary supporting Intel and M1 on macOS machines without Rosetta.

View File

@ -21,7 +21,7 @@ then
fi
codesign -s "$CODESIGN_IDENTITY" -i com.fleetdm.orbit -f -v --timestamp --options runtime "$1"
zip -r dist/orbit_darwin_amd64 dist/orbit_darwin_amd64
zip -r dist/orbit-macos_darwin_all dist/orbit-macos_darwin_all
go run github.com/mitchellh/gon/cmd/gon orbit/.gon.hcl
echo "Signed successfully"