-
-
Notifications
You must be signed in to change notification settings - Fork 59
42 lines (38 loc) · 1.24 KB
/
create-unity-matrix.yml
File metadata and controls
42 lines (38 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: Create Unity Version Matrix
on:
workflow_call:
inputs:
event-name:
description: 'Event name (pull_request, push, etc.)'
required: true
type: string
outputs:
unity-matrix:
description: 'Unity version matrix'
value: ${{ jobs.create-unity-matrix.outputs.unity-matrix }}
env:
# Unity versions used in PRs
PR_UNITY_VERSIONS: '["2022.3", "6000.0", "6000.3"]'
# Unity versions used on main branch
FULL_UNITY_VERSIONS: '["2021.3", "2022.3", "6000.0", "6000.3"]'
jobs:
create-unity-matrix:
runs-on: ubuntu-latest
outputs:
unity-matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Set Unity version matrices based on event type
id: set-matrix
shell: bash
env:
EVENT_NAME: ${{ inputs.event-name }}
PR_UNITY_VERSIONS_VALUE: ${{ env.PR_UNITY_VERSIONS }}
FULL_UNITY_VERSIONS_VALUE: ${{ env.FULL_UNITY_VERSIONS }}
run: |
if [[ "$EVENT_NAME" == "pull_request" ]]; then
versions="$PR_UNITY_VERSIONS_VALUE"
else
versions="$FULL_UNITY_VERSIONS_VALUE"
fi
# Unity version matrix
echo "matrix={\"unity-version\":$versions}" >> $GITHUB_OUTPUT