Skip to content

Commit e62735a

Browse files
Release 1.0.0 (#1)
1 parent a29860e commit e62735a

File tree

3 files changed

+113
-0
lines changed

3 files changed

+113
-0
lines changed
File renamed without changes.

README.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# XRTK Unity Build
2+
3+
A GitHub Action that builds XRTK based projects.
4+
5+
Part of the [Mixed Reality Toolkit (XRTK)](https://github.com/XRTK) open source project.
6+
7+
> This action requires that your Unity project be setup and using the com.xrtk.core package.
8+
9+
## How to use
10+
11+
```yaml
12+
on:
13+
push:
14+
branches:
15+
- 'main'
16+
pull_request:
17+
branches:
18+
- '*'
19+
20+
# Allows you to run this workflow manually from the Actions tab
21+
workflow_dispatch:
22+
23+
concurrency:
24+
group: ${{ github.ref }}
25+
cancel-in-progress: true
26+
27+
jobs:
28+
build:
29+
runs-on: ${{ matrix.os }}
30+
strategy:
31+
matrix:
32+
include:
33+
- os: windows-latest
34+
build-target: StandaloneWindows64
35+
- os: macos-latest
36+
build-target: StandaloneOSX
37+
- os: linux-latest
38+
build-target: StandaloneLinux64
39+
40+
steps:
41+
- uses: actions/checkout@v2
42+
with:
43+
submodules: recursive
44+
clean: true
45+
46+
- name: Unity Build (${{ matrix.build-target }})
47+
uses: xrtk/unity-build@main
48+
with:
49+
build-target: ${{ matrix.build-target }}
50+
```

action.yaml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: 'Unity Build (XRTK)'
2+
description: 'Runs a Build using the specified build targets'
3+
branding:
4+
icon: ''
5+
color: ''
6+
7+
inputs:
8+
build-target:
9+
description: 'The build target to build for.'
10+
# Unity -buildTarget command line args https://docs.unity3d.com/Manual/CommandLineArguments.html
11+
# StandaloneWindows64, WSAPlayer, StandaloneOSX, iOS, StandaloneLinux64, Android, Lumin, WebGL
12+
defaults: ''
13+
14+
runs:
15+
using: "composite"
16+
steps:
17+
- id: unity-validate
18+
name: Unity Editor Validation
19+
uses: xrtk/unity-validate@main
20+
21+
- uses: xrtk/unity-action@main
22+
name: Project Validation
23+
with:
24+
name: 'project-validation'
25+
editor-path: '${{ steps.unity-validate.outputs.editor-path }}'
26+
project-path: '${{ steps.unity-validate.outputs.project-path }}'
27+
args: '-quit -batchmode -executeMethod XRTK.Editor.BuildPipeline.UnityPlayerBuildTools.ValidateProject'
28+
29+
- uses: xrtk/unity-action@main
30+
name: '${{ inputs.build-target }}-Tests'
31+
with:
32+
name: '${{ inputs.build-target }}-Tests'
33+
editor-path: '${{ steps.unity-validate.outputs.editor-path }}'
34+
project-path: '${{ steps.unity-validate.outputs.project-path }}'
35+
build-target: '${{ inputs.build-target }}'
36+
args: '-batchmode -runEditorTests'
37+
38+
- uses: xrtk/unity-action@main
39+
name: '${{ inputs.build-target }}-Build'
40+
with:
41+
name: '${{ inputs.build-target }}-Build'
42+
editor-path: '${{ steps.unity-validate.outputs.editor-path }}'
43+
project-path: '${{ steps.unity-validate.outputs.project-path }}'
44+
build-target: '${{ inputs.build-target }}'
45+
args: '-quit -batchmode -executeMethod XRTK.Editor.BuildPipeline.UnityPlayerBuildTools.StartCommandLineBuild'
46+
47+
- name: Zip Artifacts
48+
if: always()
49+
run: |
50+
$artifacts = "${{ steps.unity-validate.outputs.project-path }}/Builds"
51+
52+
if (Test-Path -Path $artifacts) {
53+
Compress-Archive -Path "$artifacts/*" -DestinationPath ${{ github.workspace }}/${{ runner.os }}-${{ inputs.build-target }}-Artifacts.zip -Force
54+
Remove-Item $artifacts -Force -Recurse
55+
}
56+
shell: pwsh
57+
58+
- uses: actions/upload-artifact@v2
59+
name: Upload Artifacts
60+
if: always()
61+
with:
62+
name: '${{ runner.os }}-${{ inputs.build-target }}-Artifacts'
63+
path: '${{ github.workspace }}/${{ runner.os }}-${{ inputs.build-target }}-Artifacts.zip'

0 commit comments

Comments
 (0)