From d8f8573a8d7244e129c8f8804484d7431b489a60 Mon Sep 17 00:00:00 2001 From: halprin Date: Wed, 8 Jan 2025 17:33:39 -0700 Subject: [PATCH 1/2] Set-up for universal binary, sign, and notarize --- .github/workflows/ci.yml | 7 ++++-- .github/workflows/release.yml | 40 +++++++++++++++++++++++------------ .gitignore | 3 +-- Makefile | 10 +++++++-- 4 files changed, 40 insertions(+), 20 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dff13cc..5f00b85 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d7d1237..d78c66e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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: ./evn-pilot-conversion + 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: EVN Pilot Conversion + archive-file-path: ./evn-pilot-conversion.dmg + + - name: Upload Release Asset + run: gh release upload ${{ github.event.release.tag_name }} ./evn-pilot-conversion.dmg --clobber + env: + GH_TOKEN: ${{ github.token }} diff --git a/.gitignore b/.gitignore index ff22b96..b0fb730 100644 --- a/.gitignore +++ b/.gitignore @@ -4,8 +4,7 @@ *.dll *.so *.dylib -/cloud-backup -/cloud-backup-local +/cloud-backup* # Test binary, built with `go test -c` *.test diff --git a/Makefile b/Makefile index 1f83ecc..ef9a7b1 100644 --- a/Makefile +++ b/Makefile @@ -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/ From c8ff21ab90091aec8c3a2e8cd362b178f43928a5 Mon Sep 17 00:00:00 2001 From: halprin Date: Wed, 8 Jan 2025 17:37:49 -0700 Subject: [PATCH 2/2] update release for this binary --- .github/workflows/release.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d78c66e..ac16945 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -27,16 +27,16 @@ jobs: - uses: halprin/macos-sign-package-notarize@v1 with: - path-to-binary: ./evn-pilot-conversion + 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: EVN Pilot Conversion - archive-file-path: ./evn-pilot-conversion.dmg + archive-disk-name: Cloud Backup + archive-file-path: ./cloud-backup.dmg - name: Upload Release Asset - run: gh release upload ${{ github.event.release.tag_name }} ./evn-pilot-conversion.dmg --clobber + run: gh release upload ${{ github.event.release.tag_name }} ./cloud-backup.dmg --clobber env: GH_TOKEN: ${{ github.token }}