94 lines
2.3 KiB
YAML
94 lines
2.3 KiB
YAML
workspace:
|
|
base: /studio
|
|
path: idle-survivors
|
|
|
|
variables:
|
|
- &base_image 'unityci/editor:2022.3.4f1-base-1'
|
|
- &win_mono_image 'unityci/editor:2022.3.4f1-windows-mono-1'
|
|
- all_env: &all_env
|
|
- BUILD_NAME=idle-survivors
|
|
- UNITY_VERSION=2022.3.4f1
|
|
- UNITY_DIR=/studio/idle-survivors
|
|
- build_env: &build_env
|
|
- VERSION_NUMBER_VAR=${CI_COMMIT_BRANCH}-${CI_PIPELINE_NUMBER}
|
|
- VERSION_BUILD_VAR=${CI_COMMIT_HASH}
|
|
- test_env: &test_env
|
|
- TESTING_TYPE=NUNIT
|
|
- secrets: &secrets_list
|
|
- unity_license
|
|
- before_script: &before_script
|
|
- chmod +x $UNITY_DIR/ci/before_script.sh
|
|
- $UNITY_DIR/ci/before_script.sh
|
|
- test_script: &test_script
|
|
- chmod +x $UNITY_DIR/ci/test.sh
|
|
- $UNITY_DIR/ci/test.sh
|
|
|
|
steps:
|
|
check-unity-version:
|
|
image: *base_image
|
|
commands:
|
|
- test "$UNITY_VERSION" = $(grep "m_EditorVersion:" "$UNITY_DIR/ProjectSettings/ProjectVersion.txt" | cut -d' ' -f2)
|
|
environment:
|
|
- <<: *all_env
|
|
setup-license:
|
|
image: *base_image
|
|
commands:
|
|
- <<: *before_script
|
|
environment:
|
|
- <<: *all_env
|
|
secrets:
|
|
- <<: *secrets_list
|
|
test-playmode:
|
|
image: *base_image
|
|
commands:
|
|
- <<: [*before_script, *test_script]
|
|
environment:
|
|
- <<: [*all_env, *build_env, *test_env]
|
|
- TEST_PLATFORM=playmode
|
|
secrets:
|
|
- <<: *secrets_list
|
|
test-editmode:
|
|
image: *base_image
|
|
commands:
|
|
- <<: [*before_script, *test_script]
|
|
environment:
|
|
- <<: [*all_env, *build_env, *test_env]
|
|
- TEST_PLATFORM=editmode
|
|
secrets:
|
|
- <<: *secrets_list
|
|
build-standalone-windows:
|
|
image: *win_mono_image
|
|
commands:
|
|
- <<: *before_script
|
|
- chmod +x ./ci/build.sh
|
|
- ./ci/build.sh
|
|
environment:
|
|
- <<: [*all_env, *build_env]
|
|
- BUILD_TARGET=StandaloneWindows64
|
|
secrets:
|
|
- <<: *secrets_list
|
|
when:
|
|
event: tag
|
|
package:
|
|
image: *win_mono_image
|
|
commands:
|
|
- tar -C $UNITY_DIR/Builds -cvzf ${CI_COMMIT_TAG}.tar.gz .
|
|
environment:
|
|
- <<: *all_env
|
|
when:
|
|
event: tag
|
|
publish:
|
|
image: woodpeckerci/plugin-gitea-release
|
|
settings:
|
|
api-key:
|
|
from_secret: gitea_api_key
|
|
files:
|
|
- ${CI_COMMIT_TAG}.tar.gz
|
|
target: main
|
|
base_url: https://git.sunturtle.xyz
|
|
when:
|
|
event: tag
|
|
|
|
when:
|
|
event: [push, tag, deployment]
|