-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from VeyronSakai/build-workflow
Fix Build workflow
- Loading branch information
Showing
12 changed files
with
123 additions
and
49 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
name: BuildTest | ||
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 | ||
|
||
jobs: | ||
android: | ||
runs-on: [self-hosted, macOS] | ||
steps: | ||
- name: Switch workspace | ||
uses: DeNA/setup-job-workspace-action@fea4ef4d011492fe235833241acbb4fced82da27 | ||
- uses: actions/checkout@v4 | ||
with: | ||
clean: "${{ env.CLEAN }}" | ||
- name: Get Unity version | ||
run: | | ||
echo "UNITY_VERSION=$(grep "m_EditorVersion:" < ProjectSettings/ProjectVersion.txt | cut -d" " -f2)" >> "${GITHUB_ENV}" | ||
- name: Android Build | ||
env: | ||
ANDROID_NDK_ROOT: "/Applications/Unity/Hub/Editor/${UNITY_VERSION}/PlaybackEngines/AndroidPlayer/NDK" | ||
run: | | ||
/Applications/Unity/Hub/Editor/"${UNITY_VERSION}"/Unity.app/Contents/MacOS/Unity \ | ||
-quit \ | ||
-batchmode \ | ||
-nographics \ | ||
-projectPath "$(pwd)" \ | ||
-executeMethod Editor.BuildEntryPoint.BuildAndroid | ||
ios: | ||
runs-on: [self-hosted, macOS] | ||
steps: | ||
- name: Switch workspace | ||
uses: DeNA/setup-job-workspace-action@fea4ef4d011492fe235833241acbb4fced82da27 | ||
- uses: actions/checkout@v4 | ||
with: | ||
clean: "${{ env.CLEAN }}" | ||
- name: Get Unity version | ||
run: | | ||
echo "UNITY_VERSION=$(grep "m_EditorVersion:" < ProjectSettings/ProjectVersion.txt | cut -d" " -f2)" >> "${GITHUB_ENV}" | ||
- name: iOS Build | ||
env: | ||
ANDROID_NDK_ROOT: "/Applications/Unity/Hub/Editor/${UNITY_VERSION}/PlaybackEngines/AndroidPlayer/NDK" | ||
run: | | ||
/Applications/Unity/Hub/Editor/"${UNITY_VERSION}"/Unity.app/Contents/MacOS/Unity \ | ||
-quit \ | ||
-batchmode \ | ||
-nographics \ | ||
-projectPath "$(pwd)" \ | ||
-executeMethod Editor.BuildEntryPoint.BuildIOS \ |
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using UnityEditor; | ||
|
||
namespace Editor | ||
{ | ||
// ReSharper disable once UnusedMember.Global | ||
public sealed class BuildEntryPoint | ||
{ | ||
// ReSharper disable once UnusedMember.Global | ||
public static void BuildAndroid() | ||
{ | ||
var buildPlayerOptions = new BuildPlayerOptions | ||
{ | ||
scenes = new[] { "Assets/Scenes/SampleScene.unity" }, | ||
locationPathName = "Outputs/Android/app.apk", | ||
target = BuildTarget.Android, | ||
options = BuildOptions.Development, | ||
}; | ||
|
||
BuildPipeline.BuildPlayer(buildPlayerOptions); | ||
} | ||
|
||
// ReSharper disable once UnusedMember.Global | ||
public static void BuildIOS() | ||
{ | ||
var buildPlayerOptions = new BuildPlayerOptions | ||
{ | ||
scenes = new[] { "Assets/Scenes/SampleScene.unity" }, | ||
locationPathName = "Outputs/IOS/", | ||
target = BuildTarget.iOS, | ||
options = BuildOptions.Development, | ||
}; | ||
|
||
BuildPipeline.BuildPlayer(buildPlayerOptions); | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
File renamed without changes.
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
m_EditorVersion: 2022.3.25f1 | ||
m_EditorVersionWithRevision: 2022.3.25f1 (530ae0ba3889) | ||
m_EditorVersion: 2022.3.26f1 | ||
m_EditorVersionWithRevision: 2022.3.26f1 (ec6cd8118806) |