update pipeline for woodpecker v1.0
This commit is contained in:
parent
51fabc12b6
commit
8f2b0daa60
@ -2,72 +2,75 @@ workspace:
|
|||||||
base: /studio
|
base: /studio
|
||||||
path: idle-survivors
|
path: idle-survivors
|
||||||
|
|
||||||
# We use a singleton "matrix" to set variables, because formal variables are a
|
variables:
|
||||||
# Woodpecker next feature.
|
- &base_image 'unityci/editor:2022.3.4f1-base-1'
|
||||||
matrix:
|
- &win_mono_image 'unityci/editor:2022.3.4f1-windows-mono-1'
|
||||||
include:
|
- all_env: &all_env
|
||||||
- BUILD_NAME: idle-survivors
|
- BUILD_NAME=idle-survivors
|
||||||
UNITY_ACTIVATION_FILE: ./unity3d.alf
|
- UNITY_VERSION=2022.3.4f1
|
||||||
IMAGE: unityci/editor
|
- UNITY_DIR=/studio/idle-survivors
|
||||||
IMAGE_VERSION: 1
|
- build_env: &build_env
|
||||||
# The GitLab version pulls the Unity version from the project information,
|
- VERSION_NUMBER_VAR=${CI_COMMIT_BRANCH}-${CI_PIPELINE_NUMBER}
|
||||||
# but I don't think Woodpecker will use that as a variable in image names.
|
- VERSION_BUILD_VAR=${CI_COMMIT_HASH}
|
||||||
# We set the version as a variable instead and check that it's right.
|
- test_env: &test_env
|
||||||
UNITY_VERSION: 2022.3.4f1
|
- TESTING_TYPE=NUNIT
|
||||||
UNITY_DIR: /studio/idle-survivors
|
- 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
|
||||||
|
|
||||||
pipeline:
|
steps:
|
||||||
check-unity-version:
|
check-unity-version:
|
||||||
image: ${IMAGE}:${UNITY_VERSION}-base-${IMAGE_VERSION}
|
image: *base_image
|
||||||
commands:
|
commands:
|
||||||
- test "$UNITY_VERSION" = $(grep "m_EditorVersion:" "${UNITY_DIR}/ProjectSettings/ProjectVersion.txt" | cut -d' ' -f2)
|
- test "$UNITY_VERSION" = $(grep "m_EditorVersion:" "$UNITY_DIR/ProjectSettings/ProjectVersion.txt" | cut -d' ' -f2)
|
||||||
|
environment:
|
||||||
|
<<: *all_env
|
||||||
setup-license:
|
setup-license:
|
||||||
image: ${IMAGE}:${UNITY_VERSION}-base-${IMAGE_VERSION}
|
image: *base_image
|
||||||
commands:
|
commands:
|
||||||
- chmod +x ${UNITY_DIR}/ci/before_script.sh
|
- <<: *before_script
|
||||||
- ${UNITY_DIR}/ci/before_script.sh
|
secrets:
|
||||||
secrets: [unity_license]
|
- <<: *secrets_list
|
||||||
test-playmode:
|
test-playmode:
|
||||||
image: ${IMAGE}:${UNITY_VERSION}-base-${IMAGE_VERSION}
|
image: *base_image
|
||||||
commands:
|
commands:
|
||||||
- ${UNITY_DIR}/ci/before_script.sh
|
- <<: [*before_script, *test_script]
|
||||||
- chmod +x ${UNITY_DIR}/ci/test.sh
|
|
||||||
- ${UNITY_DIR}/ci/test.sh
|
|
||||||
environment:
|
environment:
|
||||||
|
- <<: [*all_env, *build_env, *test_env]
|
||||||
- TEST_PLATFORM=playmode
|
- TEST_PLATFORM=playmode
|
||||||
- TESTING_TYPE=NUNIT
|
secrets:
|
||||||
- VERSION_NUMBER_VAR=${CI_COMMIT_BRANCH}-${CI_BUILD_NUMBER}
|
- <<: *secrets_list
|
||||||
- VERSION_BUILD_VAR=${CI_COMMIT_HASH}
|
|
||||||
secrets: [unity_license]
|
|
||||||
test-editmode:
|
test-editmode:
|
||||||
image: ${IMAGE}:${UNITY_VERSION}-base-${IMAGE_VERSION}
|
image: *base_image
|
||||||
commands:
|
commands:
|
||||||
- ${UNITY_DIR}/ci/before_script.sh
|
- <<: [*before_script, *test_script]
|
||||||
- chmod +x ${UNITY_DIR}/ci/test.sh
|
|
||||||
- ${UNITY_DIR}/ci/test.sh
|
|
||||||
environment:
|
environment:
|
||||||
|
- <<: [*all_env, *build_env, *test_env]
|
||||||
- TEST_PLATFORM=editmode
|
- TEST_PLATFORM=editmode
|
||||||
- TESTING_TYPE=NUNIT
|
secrets:
|
||||||
- VERSION_NUMBER_VAR=${CI_COMMIT_BRANCH}-${CI_BUILD_NUMBER}
|
- <<: *secrets_list
|
||||||
- VERSION_BUILD_VAR=${CI_COMMIT_HASH}
|
|
||||||
secrets: [unity_license]
|
|
||||||
build-standalone-windows:
|
build-standalone-windows:
|
||||||
image: ${IMAGE}:${UNITY_VERSION}-windows-mono-${IMAGE_VERSION}
|
image: *win_mono_image
|
||||||
commands:
|
commands:
|
||||||
- ${UNITY_DIR}/ci/before_script.sh
|
- <<: *before_script
|
||||||
- chmod +x ./ci/build.sh
|
- chmod +x ./ci/build.sh
|
||||||
- ./ci/build.sh
|
- ./ci/build.sh
|
||||||
environment:
|
environment:
|
||||||
|
- <<: [*all_env, *build_env]
|
||||||
- BUILD_TARGET=StandaloneWindows64
|
- BUILD_TARGET=StandaloneWindows64
|
||||||
- VERSION_NUMBER_VAR=${CI_COMMIT_TAG}
|
secrets:
|
||||||
- VERSION_BUILD_VAR=${CI_COMMIT_HASH}
|
- <<: *secrets_list
|
||||||
secrets: [unity_license]
|
|
||||||
when:
|
when:
|
||||||
event: tag
|
event: tag
|
||||||
package:
|
package:
|
||||||
image: ${IMAGE}:${UNITY_VERSION}-windows-mono-${IMAGE_VERSION}
|
image: *win_mono_image
|
||||||
commands:
|
commands:
|
||||||
- tar -C ${UNITY_DIR}/Builds -cvzf ${CI_COMMIT_TAG}.tar.gz .
|
- tar -C $UNITY_DIR/Builds -cvzf ${CI_COMMIT_TAG}.tar.gz .
|
||||||
when:
|
when:
|
||||||
event: tag
|
event: tag
|
||||||
publish:
|
publish:
|
||||||
@ -81,3 +84,6 @@ pipeline:
|
|||||||
base_url: https://git.sunturtle.xyz
|
base_url: https://git.sunturtle.xyz
|
||||||
when:
|
when:
|
||||||
event: tag
|
event: tag
|
||||||
|
|
||||||
|
when:
|
||||||
|
event: [pull_request, tag, deployment]
|
||||||
|
Loading…
Reference in New Issue
Block a user