Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/build-options.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"os": [
"ubuntu-latest",
"windows-latest",
"macos-latest"
],
"unity-version": [
"2019",
"2020",
"2022",
"6000.0",
"6000.1",
"6000.2"
],
"include": [
{
"os": "ubuntu-latest",
"build-target": "StandaloneLinux64"
},
{
"os": "ubuntu-latest",
"build-target": "WebGL",
"build-args": "-colorSpace Gamma"
},
{
"os": "ubuntu-latest",
"build-target": "Android"
},
{
"os": "windows-latest",
"build-target": "StandaloneWindows64"
},
{
"os": "windows-latest",
"build-target": "Android"
},
{
"os": "macos-latest",
"build-target": "StandaloneOSX"
},
{
"os": "macos-latest",
"build-target": "iOS"
}
]
}
73 changes: 73 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: build
permissions:
contents: read
on:
workflow_call:
inputs:
matrix:
required: true
type: string
secrets:
UNITY_USERNAME:
required: true
UNITY_PASSWORD:
required: true
jobs:
build:
name: ${{ matrix.name }}
strategy:
matrix: ${{ fromJSON(inputs.matrix) }}
fail-fast: false
runs-on: ${{ matrix.os }}
permissions:
contents: read
steps:
- name: Free Disk Space
if: ${{ matrix.os == 'ubuntu-latest' && matrix.unity-version == '6000.2' }}
uses: endersonmenezes/free-disk-space@713d134e243b926eba4a5cce0cf608bfd1efb89a # v2.1.1
with:
remove_android: true
remove_dotnet: false
- uses: actions/checkout@v5
- uses: buildalon/unity-setup@main
with:
version-file: None
build-targets: ${{ matrix.build-target }}
unity-version: ${{ matrix.unity-version }}
- uses: buildalon/activate-unity-license@main
with:
license: Personal
username: ${{ secrets.UNITY_USERNAME }}
password: ${{ secrets.UNITY_PASSWORD }}
- uses: ./ #buildalon/create-unity-project
id: unity-project
with:
project-name: Test Project
- name: Add Build Pipeline Package
run: |
npm install -g openupm-cli
openupm add com.utilities.buildpipeline
working-directory: ${{ steps.unity-project.outputs.project-path }}
shell: bash
- uses: buildalon/unity-action@main
name: ${{ matrix.build-target }}-Validate
with:
build-target: ${{ matrix.build-target }}
project-path: ${{ steps.unity-project.outputs.project-path }}
log-name: ${{ matrix.build-target }}-Validate
args: -quit -nographics -batchmode -executeMethod Utilities.Editor.BuildPipeline.UnityPlayerBuildTools.ValidateProject -importTMProEssentialsAsset
- uses: buildalon/unity-action@main
name: ${{ matrix.build-target }}-Build
with:
build-target: ${{ matrix.build-target }}
project-path: ${{ steps.unity-project.outputs.project-path }}
log-name: ${{ matrix.build-target }}-Build
args: -quit -nographics -batchmode -executeMethod Utilities.Editor.BuildPipeline.UnityPlayerBuildTools.StartCommandLineBuild -sceneList Assets/Scenes/SampleScene.unity ${{ matrix.build-args }}
- uses: actions/upload-artifact@v4
name: Upload Artifacts
if: always()
with:
name: ${{ github.run_number }}.${{ github.run_attempt }} ${{ matrix.os }} ${{ matrix.unity-version }} ${{ matrix.build-target }} Artifacts
path: |
${{ github.workspace }}/**/*.log
${{ github.workspace }}/**/Builds/${{ matrix.build-target }}/
2 changes: 1 addition & 1 deletion .github/workflows/update-release-tags.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
fetch-depth: 0
- uses: RageAgainstThePixel/update-action-release-tags@v1
53 changes: 53 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: validate
on:
schedule:
- cron: '0 0 * * 0' # Every Sunday at midnight
push:
branches: ['main']
pull_request:
branches: ['*']
types: [opened, synchronize, reopened, ready_for_review]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
setup:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v5
with:
sparse-checkout: .github/
- uses: RageAgainstThePixel/job-builder@v1
id: setup-jobs
with:
build-options: ./.github/workflows/build-options.json
group-by: 'unity-version'
outputs:
jobs: ${{ steps.setup-jobs.outputs.jobs }}
validate:
if: ${{ needs.setup.outputs.jobs }}
needs: setup
name: build ${{ matrix.jobs.name }}
permissions:
contents: read
strategy:
matrix: ${{ fromJSON(needs.setup.outputs.jobs) }}
fail-fast: false
max-parallel: 1
secrets: inherit
uses: ./.github/workflows/build.yml
with:
matrix: ${{ toJSON(matrix.jobs.matrix) }}
timeline:
needs: [setup, validate]
if: always()
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: Kesin11/actions-timeline@c2f474758e8e9ac6f37ec64a6442dead7fd1dad2 # v2.2.5
continue-on-error: true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# create-unity-project

[![Discord](https://img.shields.io/discord/939721153688264824.svg?label=&logo=discord&logoColor=ffffff&color=7389D8&labelColor=6A7EC2)](https://discord.gg/VM9cWJ9rjH) [![marketplace](https://img.shields.io/static/v1?label=&labelColor=505050&message=Buildalon%20Actions&color=FF1E6F&logo=github-actions&logoColor=0076D6)](https://github.com/marketplace?query=buildalon)

[![Discord](https://img.shields.io/discord/939721153688264824.svg?label=&logo=discord&logoColor=ffffff&color=7389D8&labelColor=6A7EC2)](https://discord.gg/VM9cWJ9rjH) [![marketplace](https://img.shields.io/static/v1?label=&labelColor=505050&message=Buildalon%20Actions&color=FF1E6F&logo=github-actions&logoColor=0076D6)](https://github.com/marketplace?query=buildalon)

A GitHub Action to create a new Unity Project using a predefined template package.

Expand All @@ -27,7 +26,7 @@ A GitHub Action to create a new Unity Project using a predefined template packag

```yaml
steps:
- uses: buildalon/create-unity-project@v1
- uses: buildalon/create-unity-project@v2
with:
project-name: Test Project
project-directory: ./Unity Project
Expand Down
17 changes: 2 additions & 15 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,6 @@ inputs:
outputs:
project-path:
description: The path to the created Unity project.
value: '${{ inputs.project-directory }}/${{ inputs.project-name }}'
runs:
using: composite
steps:
- name: Get Unity Template
id: template
shell: bash
env:
ACTION_PATH: ${{ github.action_path }}
TEMPLATE_NAME: ${{ inputs.template-name }}
run: '"${ACTION_PATH}/get-unity-template.sh" "${TEMPLATE_NAME}"'
- uses: buildalon/unity-action@v2
name: Create Unity Project
with:
log-name: create-unity-project
args: '-quit -nographics -batchmode -createProject "${{ inputs.project-directory }}/${{ inputs.project-name }}" -cloneFromTemplate "${{ steps.template.outputs.template-path }}"'
using: 'node20'
main: 'dist/index.js'
Loading
Loading