Skip to content

Sign MacOS Binaries with JFrog Certificate #1

Sign MacOS Binaries with JFrog Certificate

Sign MacOS Binaries with JFrog Certificate #1

# This workflow is responsible for building and signing and uploading macOS CLI binaries.
# The CLI release job will consume the produced binaries.
name: Prepare MacOS binaries for CLI release
on: [ push ]
jobs:
# Delete old artifacts before signing new binaries
# To allow the release job to better find the signed binaries
DeleteOldArtifacts:
name: Delete-Old-Artifacts
runs-on: ubuntu-latest
steps:
- uses: kolpav/purge-artifacts-action@v1
with:
token: ${{ secrets.JF_GIT_TOKEN }}
expire-in: 0 # Setting this to 0 will delete all artifacts
prepareBinary:
# if: ${{ contains(github.event.head_commit.message, 'Bump version from') }}
needs: DeleteOldArtifacts
name: Sign-JFrog-CLI-MacOS-Binary
runs-on: macos-latest
strategy:
matrix:
goarch: [ arm64,amd64 ]
steps:
# Setup
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: 1.22.x
cache: false
- name: Set Environment Variable
run: echo "goarch=${{ matrix.goarch }}" >> $GITHUB_ENV
# Build
- name: Checkout Source
uses: actions/checkout@v4
run: ./build/build.sh
# Sign
- name: Sign Binary
env:
APPLE_CERT_DATA: ${{ secrets.APPLE_CERT_DATA }}
APPLE_CERT_PASSWORD: ${{ secrets.APPLE_CERT_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
run: ./build/macOsSign/signMacOsBinary.sh
# Upload
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: jf-darwin-${{ matrix.goarch }}
path: ./jf
retention-days: 1