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 - VERSION_NUMBER_VAR: ${CI_COMMIT_BRANCH}-${CI_BUILD_NUMBER} - VERSION_BUILD_VAR: ${CI_COMMIT_HASH} 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 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 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 package: image: ${IMAGE}:${UNITY_VERSION}-windows-mono-${IMAGE_VERSION} commands: - tar -C ${UNITY_DIR}/Builds -cvzf ${VERSION_NUMBER_VAR}.tar.gz . when: event: tag publish: image: woodpeckerci/plugin-gitea-release settings: api-key: from_secret: gitea_api_key files: - ${VERSION_NUMBER_VAR}.tar.gz target: main base_url: https://git.sunturtle.xyz when: event: tag