-
-
Notifications
You must be signed in to change notification settings - Fork 20
75 lines (69 loc) · 2.71 KB
/
update_unity_package.yml
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Build Unity Package
# Controls when the action will run. Triggers the workflow on pushing changes to develop that include
# updating the 'VersionConstants.cs' since this asset will change only on a new version
on:
push:
branches: [ develop ]
paths:
- 'Unity/Assets/JCMG/PackageTools/Scripts/Editor/VersionConstants.cs'
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
runs-on: ubuntu-latest
steps:
# Check out the 'develop' and 'release/stable' branch
- uses: actions/checkout@v2
with:
ref: 'develop'
path: './unity-package-tools'
- uses: actions/checkout@v2
with:
ref: 'release/stable'
path: './unity-package-tools_release'
# Retrieve cache for Unity project
- name: Retrieve Unity Library Cache
uses: actions/[email protected]
with:
path: './unity-package-tools/Unity/Library'
key: Library-PackageTools-Windows
restore-keys: |
Library-PackageTools
# Execute Unity Unit Tests and Upload results
- name: Run Unity Unit Tests
uses: webbertakken/[email protected]
env:
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }}
with:
projectPath: './unity-package-tools/Unity'
unityVersion: 2019.4.11f1
- name: Upload Unit Test Results
uses: actions/upload-artifact@v1
with:
name: Test results
path: artifacts
# Build Unity Package on Develop branch
- name: Execute Unity Package Build
uses: webbertakken/[email protected]
env:
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }}
with:
projectPath: './unity-package-tools/Unity'
unityVersion: 2019.4.11f1
buildMethod: 'JCMG.PackageTools.Editor.PackageToolsCI.Generate'
allowDirtyBuild: true
# Check in Unity Package on Release branch
- name: Add & Commit Release Changes
uses: EndBug/[email protected]
env:
# This is necessary in order to push a commit to the repo
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Leave this line unchanged
with:
author_name: Github Action Bot
cwd: './unity-package-tools_release'
branch: 'release/stable'
message: 'Auto-updated package contents'