Merge pull request #30 from noir-neo/fix-install-path #17
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.APPLE_CERTIFICATE_P12 }} | |
p12-password: ${{ secrets.APPLE_CERTIFICATE_P12_PASSWORD }} | |
- name: Post Process Build | |
env: | |
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} | |
APPLE_TEAM_NAME: ${{ secrets.APPLE_TEAM_NAME }} | |
APPLE_ID: ${{ secrets.APPLE_ID }} | |
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }} | |
MAC_BUILD_PATH: ${{ format('{0}/build/StandaloneOSX', github.workspace) }} | |
PROJECT_NAME: hatbor | |
BUNDLE_IDENTIFIER: com.neoneobeam.hatbor | |
VERSION: ${{ steps.buildStep.outputs.buildVersion }} | |
run: ./post-process-build-mac.sh | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: hatbor-macOS-${{ steps.buildStep.outputs.buildVersion }} | |
path: hatbor.dmg | |
- name: Upload to Discord | |
env: | |
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} | |
FILE: hatbor.dmg | |
CONTENT: ${{ format('hatbor {0} for macOS', steps.buildStep.outputs.buildVersion) }} | |
run: | | |
curl \ | |
-F 'payload_json={"content":"$CONTENT"}' \ | |
-F "file1=@$FILE" \ | |
$DISCORD_WEBHOOK |