2021-01-29 18:35:49 +01:00
|
|
|
stages:
|
|
|
|
- build
|
2021-02-01 15:06:31 +01:00
|
|
|
- cleanup-build
|
2021-01-29 18:35:49 +01:00
|
|
|
- deploy
|
|
|
|
|
|
|
|
variables:
|
|
|
|
GIT_STRATEGY: fetch
|
|
|
|
|
|
|
|
UNITY_VERSION: 2020.2.2f1
|
|
|
|
|
|
|
|
SRC_DIR: ./game
|
|
|
|
BUILD_DIR: ./game/Build
|
2021-01-29 19:46:49 +01:00
|
|
|
DEV_BRANCH: feature/cd
|
2021-02-01 14:30:56 +01:00
|
|
|
PROD_BRANCH: feature/cd-2
|
2021-01-29 18:35:49 +01:00
|
|
|
|
|
|
|
build:
|
|
|
|
stage: build
|
2021-02-01 14:30:56 +01:00
|
|
|
variables:
|
2021-02-01 15:06:31 +01:00
|
|
|
# instance the build job to avoid multiple jobs running in the same project folder
|
|
|
|
GIT_CLONE_PATH: $CI_BUILDS_DIR/$CI_RUNNER_SHORT_TOKEN/$CI_PROJECT_NAME-build-$CI_PIPELINE_ID
|
2021-01-29 18:35:49 +01:00
|
|
|
script:
|
2021-02-01 12:20:34 +01:00
|
|
|
- echo "cloned to $GIT_CLONE_PATH"
|
2021-01-29 18:35:49 +01:00
|
|
|
- chmod +x ./ci/build.sh
|
|
|
|
- ./ci/build.sh $UNITY_VERSION
|
2021-02-01 15:06:31 +01:00
|
|
|
|
2021-01-29 18:35:49 +01:00
|
|
|
artifacts:
|
|
|
|
name: $CI_PROJECT_NAME-$CI_PIPELINE_ID
|
|
|
|
paths:
|
|
|
|
- $BUILD_DIR
|
2021-02-01 15:06:31 +01:00
|
|
|
|
|
|
|
# remove the directory created by the build job. in a separate job
|
|
|
|
cleanup-build:
|
|
|
|
stage: cleanup-build
|
|
|
|
variables:
|
|
|
|
CLEANUP_PATH: $CI_BUILDS_DIR/$CI_RUNNER_SHORT_TOKEN/$CI_PROJECT_NAME-build-$CI_PIPELINE_ID
|
|
|
|
script:
|
|
|
|
- echo "cleaning up build directory"
|
2021-02-01 19:00:00 +01:00
|
|
|
- rm -r $CLEANUP_PATH $CLEANUP_PATH.tmp
|
2021-02-01 15:06:31 +01:00
|
|
|
dependencies:
|
|
|
|
- build
|
2021-02-01 20:54:39 +01:00
|
|
|
when: always
|
2021-01-29 18:35:49 +01:00
|
|
|
|
2021-02-01 14:30:56 +01:00
|
|
|
# deploy to internal testing track
|
2021-01-29 19:36:11 +01:00
|
|
|
deploy-dev:
|
2021-01-29 19:46:49 +01:00
|
|
|
stage: deploy
|
2021-01-29 19:15:09 +01:00
|
|
|
rules:
|
2021-01-29 19:46:49 +01:00
|
|
|
- if: $CI_COMMIT_BRANCH == $DEV_BRANCH
|
2021-01-29 18:35:49 +01:00
|
|
|
variables:
|
|
|
|
ITCH_USER: "cyndrdev"
|
|
|
|
ITCH_GAME: "revival-internal-track"
|
|
|
|
ITCH_TRACK: "windows-unstable"
|
|
|
|
script:
|
|
|
|
- chmod +x ./ci/deploy.sh
|
|
|
|
- ./ci/deploy.sh $BUILD_DIR $ITCH_USER $ITCH_GAME $ITCH_TRACK
|
2021-01-29 19:26:10 +01:00
|
|
|
dependencies:
|
|
|
|
- build
|
2021-01-29 19:15:09 +01:00
|
|
|
|
2021-02-01 14:30:56 +01:00
|
|
|
# deploy to production
|
2021-01-29 19:36:11 +01:00
|
|
|
deploy-release:
|
2021-01-29 19:46:49 +01:00
|
|
|
stage: deploy
|
2021-01-29 19:15:09 +01:00
|
|
|
rules:
|
2021-02-01 21:13:24 +01:00
|
|
|
- if: $CI_COMMIT_BRANCH == $PROD_BRANCH && $CI_MANUAL
|
2021-01-29 19:15:09 +01:00
|
|
|
variables:
|
|
|
|
ITCH_USER: "cyndrdev"
|
|
|
|
ITCH_GAME: "revival"
|
|
|
|
ITCH_TRACK: "windows"
|
2021-01-29 19:43:23 +01:00
|
|
|
script:
|
2021-01-29 19:15:09 +01:00
|
|
|
- echo "deploy release :bolb:"
|
2021-01-29 19:26:10 +01:00
|
|
|
dependencies:
|
|
|
|
- build
|