Skip to content

Update build-mac.yml #5

Update build-mac.yml

Update build-mac.yml #5

Workflow file for this run

name: Build mac
on:
push:
branches: master
workflow_dispatch: {}
jobs:
build:
name: Build for StandaloneOSX
runs-on: macos-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: actions/cache@v3
with:
path: Library
key: Library-${{ hashFiles('Assets/**', 'Packages/**', 'ProjectSettings/**') }}
restore-keys: |
Library-
- name: Build project
uses: game-ci/unity-builder@v4
id: buildStep
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
targetPlatform: StandaloneOSX
buildName: hatbor
versioning: Semantic
- name: Import Apple Certificate
uses: apple-actions/import-codesign-certs@v1
with:
p12-file-base64: ${{ secrets.DEVELOPER_ID_APPLICATION_CERTIFICATE_P12 }}
p12-password: ${{ secrets.DEVELOPER_ID_APPLICATION_CERTIFICATE_P12_PASSWORD }}
- name: codesign
env:
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
APPLE_TEAM_NAME: ${{ secrets.APPLE_TEAM_NAME }}
MAC_BUILD_PATH: ${{ format('{0}/build/StandaloneOSX', github.workspace) }}
PROJECT_NAME: hatbor
run: |
chmod -R a+xr "${MAC_BUILD_PATH}/${PROJECT_NAME}.app"
codesign \
--deep \
--force \
--verify \
--verbose \
--timestamp \
--options runtime \
--entitlements "${PROJECT_NAME}.entitlements" \
--sign "Developer ID Application: ${APPLE_TEAM_NAME} (${APPLE_TEAM_ID})" "${MAC_BUILD_PATH}/${PROJECT_NAME}.app"
- uses: actions/upload-artifact@v3
with:
name: hatbor-macOS-${{ steps.buildStep.outputs.buildVersion }}
path: build/StandaloneOSX