workspace: base: /studio path: idle-survivors # We use a singleton "matrix" to set variables, because formal variables are a # Woodpecker next feature. matrix: include: - BUILD_NAME: idle-survivors UNITY_ACTIVATION_FILE: ./unity3d.alf IMAGE: unityci/editor IMAGE_VERSION: 1 # The GitLab version pulls the Unity version from the project information, # but I don't think Woodpecker will use that as a variable in image names. # We set the version as a variable instead and check that it's right. UNITY_VERSION: 2022.3.4f1 UNITY_DIR: /studio/idle-survivors pipeline: check-unity-version: image: ${IMAGE}:${UNITY_VERSION}-base-${IMAGE_VERSION} commands: - test "$UNITY_VERSION" = $(grep "m_EditorVersion:" "${UNITY_DIR}/ProjectSettings/ProjectVersion.txt" | cut -d' ' -f2) setup-license: image: ${IMAGE}:${UNITY_VERSION}-base-${IMAGE_VERSION} commands: - chmod +x ${UNITY_DIR}/ci/before_script.sh - ${UNITY_DIR}/ci/before_script.sh secrets: [unity_license] test-playmode: image: ${IMAGE}:${UNITY_VERSION}-base-${IMAGE_VERSION} group: test commands: - chmod +x ${UNITY_DIR}/ci/test.sh - ${UNITY_DIR}/ci/test.sh environment: - TEST_PLATFORM=playmode - TESTING_TYPE=NUNIT - VERSION_NUMBER_VAR=${CI_COMMIT_BRANCH}-${CI_BUILD_NUMBER} - VERSION_BUILD_VAR=${CI_COMMIT_HASH} when: branch: exclude: [main] test-editmode: image: ${IMAGE}:${UNITY_VERSION}-base-${IMAGE_VERSION} group: test commands: - chmod +x ${UNITY_DIR}/ci/test.sh - ${UNITY_DIR}/ci/test.sh environment: - TEST_PLATFORM=editmode - TESTING_TYPE=NUNIT - VERSION_NUMBER_VAR=${CI_COMMIT_BRANCH}-${CI_BUILD_NUMBER} - VERSION_BUILD_VAR=${CI_COMMIT_HASH} when: branch: exclude: [main] build-standalone-windows: image: ${IMAGE}:${UNITY_VERSION}-windows-mono-${IMAGE_VERSION} group: build commands: - chmod +x ./ci/build.sh - ./ci/build.sh environment: - BUILD_TARGET=StandaloneWindows64 - VERSION_NUMBER_VAR=${CI_COMMIT_TAG} - VERSION_BUILD_VAR=${CI_COMMIT_HASH} when: event: tag package: image: ${IMAGE}:${UNITY_VERSION}-windows-mono-${IMAGE_VERSION} commands: - tar -C ${UNITY_DIR}/Builds -cvzf ${CI_COMMIT_TAG}.tar.gz . 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