Bump DeNA/setup-job-workspace-action from cfd2a6af0a6f6f750d803c1c46091c7bf52f62d7 to 57538e37da835c5697b3fa18800656cfc9e1c5f9 #60
Workflow file for this run
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 | |
on: | |
pull_request: | |
workflow_dispatch: | |
inputs: | |
clean: | |
type: boolean | |
default: false | |
description: "clean" | |
env: | |
CLEAN: ${{ github.event.inputs.clean || false }} | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
permissions: | |
contents: read | |
pull-requests: read | |
jobs: | |
paths-filter: | |
name: Paths Filter for Build | |
runs-on: ubuntu-latest | |
outputs: | |
should-build: ${{ steps.filter.outputs.should-build }} | |
steps: | |
- uses: actions/checkout@v4 | |
if: ${{ github.event_name == 'pull_request' }} | |
- uses: dorny/paths-filter@v3 | |
id: filter | |
if: ${{ github.event_name == 'pull_request' }} | |
with: | |
filters: | | |
should-build: | |
- "Editor/**/*" | |
- "Runtime/**/*" | |
- "Samples~/**/*" | |
- ".github/workflows/build.yml" | |
get-unity-version: | |
name: Get Unity Version | |
needs: paths-filter | |
if: ${{ (github.event_name == 'pull_request' && needs.paths-filter.outputs.should-build == 'true') || github.event_name == 'workflow_dispatch'}} | |
runs-on: ubuntu-latest | |
env: | |
PROJECT_VERSION_PATH: Samples~/ProjectSettings/ProjectVersion.txt | |
outputs: | |
unity-version: ${{ steps.get-unity-version.outputs.unity-version }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
sparse-checkout: ${{ env.PROJECT_VERSION_PATH }} | |
clean: "${{ env.CLEAN }}" | |
- name: Get Unity version | |
id: get-unity-version | |
run: | | |
echo "unity-version=$(grep "m_EditorVersion:" < "${PROJECT_VERSION_PATH}" | cut -d" " -f2)" >> "${GITHUB_OUTPUT}" | |
macos: | |
name: Build for macOS | |
needs: get-unity-version | |
runs-on: [self-hosted, macOS] | |
steps: | |
- name: Switch workspace | |
uses: DeNA/setup-job-workspace-action@57538e37da835c5697b3fa18800656cfc9e1c5f9 | |
- uses: actions/checkout@v4 | |
with: | |
clean: "${{ env.CLEAN }}" | |
- name: macOS Build | |
env: | |
UNITY_VERSION: ${{ needs.get-unity-version.outputs.unity-version }} | |
run: | | |
/Applications/Unity/Hub/Editor/"${UNITY_VERSION}"/Unity.app/Contents/MacOS/Unity \ | |
-quit \ | |
-batchmode \ | |
-nographics \ | |
-projectPath ./Samples~ \ | |
-executeMethod Editor.BuildEntryPoint.BuildMacOS |