UniTask/.circleci/config.yml

115 lines
4.1 KiB
YAML
Raw Permalink Normal View History

2019-05-20 00:09:12 +08:00
version: 2.1
executors:
2019-05-20 00:43:04 +08:00
unity:
# https://hub.docker.com/r/gableroux/unity3d/tags
parameters:
version: {type: string}
2019-05-20 00:09:12 +08:00
docker:
2019-05-20 00:43:04 +08:00
- image: gableroux/unity3d:<< parameters.version >>
go:
docker:
- image: circleci/golang
2019-05-20 00:09:12 +08:00
commands:
unity_activate:
2019-05-20 00:34:37 +08:00
parameters:
unity_version: {type: string}
unity_license: {type: string}
2019-05-20 00:21:38 +08:00
steps:
2019-05-20 00:09:12 +08:00
# get activation file, if fail to activate unity, use this key and activate from https://license.unity3d.com/manual
- run: apt update && apt install libunwind8 -y
- run: /opt/Unity/Editor/Unity -quit -batchmode -nographics -logFile -createManualActivationFile || exit 0
2019-05-20 00:53:33 +08:00
- run: cat Unity_v<< parameters.unity_version >>.alf
2019-05-20 00:09:12 +08:00
# get from UNITY_LICENSE envvar(base64 encoded(cat foo.ulf | base64 )), this file is generated from above manual activation
- run: echo << parameters.unity_license >> | base64 -di >> .circleci/Unity.ulf
- run: /opt/Unity/Editor/Unity -quit -batchmode -nographics -silent-crashes -logFile -manualLicenseFile .circleci/Unity.ulf || exit 0
jobs:
build-and-test:
2019-05-20 00:34:37 +08:00
parameters:
unity_version: {type: string}
unity_license: {type: string}
2019-05-20 00:43:04 +08:00
executor:
name: unity
version: << parameters.unity_version >>
2019-05-20 00:09:12 +08:00
steps:
- checkout
2019-05-20 00:43:04 +08:00
- unity_activate:
unity_version: << parameters.unity_version >>
unity_license: << parameters.unity_license >>
2019-05-20 01:12:11 +08:00
- run:
name: Build Linux(Mono)
command: /opt/Unity/Editor/Unity -quit -batchmode -nographics -silent-crashes -logFile -projectPath . -executeMethod UnitTestBuilder.BuildUnitTest /headless /ScriptBackend Mono2x /BuildTarget StandaloneLinux64
working_directory: .
2019-06-06 10:58:19 +08:00
# TODO:check unity version and packages...
# - run: ./bin/UnitTest/StandaloneLinux64_Mono2x/test
2019-05-20 01:12:11 +08:00
build-and-create-package:
parameters:
unity_version: {type: string}
unity_license: {type: string}
executor:
name: unity
version: << parameters.unity_version >>
steps:
- checkout
- unity_activate:
unity_version: << parameters.unity_version >>
unity_license: << parameters.unity_license >>
- run:
name: Export unitypackage
command: /opt/Unity/Editor/Unity -quit -batchmode -nographics -silent-crashes -logFile -projectPath . -executeMethod PackageExporter.Export
working_directory: .
2019-05-20 01:15:17 +08:00
- store_artifacts:
2019-05-20 01:12:11 +08:00
path: ./UniRx.Async.unitypackage
destination: /UniRx.Async.unitypackage
# upload to github by ghr
upload-github:
executor: go
steps:
- attach_workspace:
at: .
- run: go get github.com/tcnksm/ghr
- run: ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} ${CIRCLE_TAG} .
- store_artifacts:
path: UniRx.Async.unitypackage
destination: UniRx.Async.unitypackage
2019-05-20 00:09:12 +08:00
workflows:
version: 2
build-unity:
jobs:
2019-05-20 01:31:30 +08:00
# does not exists yet.
# - build-and-test:
# unity_version: 2019.3.0a2
# unity_license: ${UNITY_LICENSE_2019_3}
# - build-and-test:
# unity_version: 2019.2.0b2
# unity_license: ${UNITY_LICENSE_2019_2}
2019-05-20 00:56:07 +08:00
- build-and-test:
2019-05-20 01:31:30 +08:00
unity_version: 2019.1.2f1
2019-05-20 00:53:33 +08:00
unity_license: ${UNITY_LICENSE_2019_1}
2020-04-16 19:55:27 +08:00
filters:
tags:
only: /.*/
2019-05-20 01:55:34 +08:00
# test asmdef will not found.
# - build-and-test:
# unity_version: 2018.4.0f1
# unity_license: ${UNITY_LICENSE_2018_4}
# # UniTask minimum support version is 2018.3(C# 7.x)
# - build-and-test:
# unity_version: 2018.3.12f1
# unity_license: ${UNITY_LICENSE_2018_3}
2020-04-17 10:31:27 +08:00
- build-and-create-package:
2020-04-16 19:55:27 +08:00
unity_version: 2019.1.2f1
unity_license: ${UNITY_LICENSE_2019_1}
filters:
tags:
only: /^\d\.\d\.\d.*/
branches:
ignore: /.*/
- upload-github:
requires:
2020-04-17 10:31:27 +08:00
- build-and-create-package
filters:
tags:
only: /^\d\.\d\.\d.*/
branches:
2020-04-17 10:31:27 +08:00
ignore: /.*/