Skip to content

macos build fix2

macos build fix2 #914

Workflow file for this run

name: Test macOS Build
on:
push:
branches:
- macos_build_failure_testing
pull_request:
branches:
- macos_build_failure_testing
workflow_dispatch:
jobs:
test-macos-build:
name: Test macOS Dashmate Build
runs-on: macos-14
steps:
- name: Check out repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Configure AWS credentials and bucket region
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: ${{ secrets.AWS_REGION }}
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- name: Retrieve JS build artifacts
uses: strophy/actions-cache@opendal-update
with:
bucket: multi-runner-cache-x1xibo9c
root: actions-cache
path: build-js-artifacts-${{ github.sha }}.tar
key: build-js-artifacts/${{ github.sha }}
- name: Unpack JS build artifacts archive
run: tar -xf build-js-artifacts-${{ github.sha }}.tar
- name: Install macOS build deps
run: |
brew install llvm coreutils
echo "/usr/local/opt/llvm/bin" >> $GITHUB_PATH
- name: Set up Docker for macOS
uses: docker-practice/actions-setup-docker@master
- name: Install the Apple certificate
env:
BUILD_CERTIFICATE_BASE64: ${{ secrets.MACOS_BUILD_CERTIFICATE_BASE64 }}
P12_PASSWORD: ${{ secrets.MACOS_P12_PASSWORD }}
KEYCHAIN_PASSWORD: ${{ secrets.MACOS_KEYCHAIN_PASSWORD }}
run: |
# create variables
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
# import certificate and provisioning profile from secrets
echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode -o $CERTIFICATE_PATH
# create temporary keychain
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
# import certificate to keychain
security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
security list-keychain -d user -s $KEYCHAIN_PATH
- name: Setup Node.JS
uses: ./.github/actions/nodejs
- name: Create package
env:
OSX_KEYCHAIN: ${{ runner.temp }}/app-signing.keychain-db
run: "${GITHUB_WORKSPACE}/scripts/pack_dashmate.sh macos"
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: dashmate-macos
path: packages/dashmate/dist/**
- name: Notarize MacOS Release Build
run: |
find packages/dashmate/dist/ -name '*.pkg' -exec sh -c 'xcrun notarytool submit "{}" --apple-id "${{ secrets.MACOS_APPLE_ID }}" --team-id "${{ secrets.MACOS_TEAM_ID }}" --password "${{ secrets.MACOS_NOTARIZING_PASSWORD }}" --wait;' \;