Skip to content

Commit

Permalink
Merge pull request #127 from halprin/sign-notarize
Browse files Browse the repository at this point in the history
Set-up for Universal Binary, Sign, and Notarize
  • Loading branch information
halprin authored Jan 9, 2025
2 parents 8a55c9b + c8ff21a commit 44f84b5
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 20 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,11 @@ jobs:
with:
go-version-file: go.mod

- name: Build
run: make compile
- name: Build for ARM64
run: make compile-arm64

- name: Build for AMD64
run: make compile-amd64

- name: Build Local Test
run: make compileLocal
40 changes: 26 additions & 14 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,34 @@ on:
jobs:
releases-matrix:
name: Release Go Binaries
runs-on: ubuntu-latest
strategy:
matrix:
goos: [darwin]
goarch: [amd64, arm64]
runs-on: macos-latest
steps:

- uses: actions/checkout@v4

- uses: wangyoucao577/go-release-action@v1.53
- uses: actions/setup-go@v5
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
goversion: go.mod
project_path: "./cmd/"
extra_files: README.md LICENSE
md5sum: FALSE
sha256sum: TRUE
go-version-file: go.mod

- run: make compile

- uses: apple-actions/import-codesign-certs@v3
with:
p12-file-base64: ${{ secrets.CERTIFICATES_P12 }}
p12-password: ${{ secrets.CERTIFICATES_P12_PASSWORD }}

- uses: halprin/macos-sign-package-notarize@v1
with:
path-to-binary: ./cloud-backup
signing-identity: ${{ secrets.SIGNING_IDENTITY }}
apple-id: ${{ secrets.APPLE_ID }}
app-specific-password: ${{ secrets.APP_SPECIFIC_PASSWORD }}
apple-developer-team-id: ${{ secrets.APPLE_DEVELOPER_TEAM_ID }}
extra-files: README.md LICENSE
archive-disk-name: Cloud Backup
archive-file-path: ./cloud-backup.dmg

- name: Upload Release Asset
run: gh release upload ${{ github.event.release.tag_name }} ./cloud-backup.dmg --clobber
env:
GH_TOKEN: ${{ github.token }}
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
*.dll
*.so
*.dylib
/cloud-backup
/cloud-backup-local
/cloud-backup*

# Test binary, built with `go test -c`
*.test
Expand Down
10 changes: 8 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
compile:
go build -o ./cloud-backup ./cmd/
compile: compile-arm64 compile-amd64
lipo -create -output cloud-backup ./cloud-backup-arm64 ./cloud-backup-amd64

compile-arm64:
GOOS=darwin GOARCH=arm64 go build -o ./cloud-backup-arm64 ./cmd/

compile-amd64:
GOOS=darwin GOARCH=amd64 go build -o ./cloud-backup-amd64 ./cmd/

compileLocal:
go build -tags localDesination -o ./cloud-backup-local ./cmd/

0 comments on commit 44f84b5

Please sign in to comment.