Common GitLab Configurations

Rules

Rules are used to control when your jobs run. We provide several common rules:

include:
  - https://ci.andtechstudios.com/default-branch/manual.yml
  #- https://ci.andtechstudios.com/default-branch/always.yml
  #- https://ci.andtechstudios.com/default-branch/merge-request/always.yml

My Job:
  stage: build
  rules:
    - !reference [.default-branch/manual, rules]
    #- !reference [.default-branch/always, rules]
    #- !reference [.default-branch/merge-request/always, rules]

Unity

In general, Unity jobs require several command line tools:

Install the required tools on your server. Then, register the machine as a GitLab Runner (shell executor).

Build

Build from Default Branch

  • Build the project and upload as a job artifact.
include:
  - https://ci.andtechstudios.com/workflows/unity/default-branch/windows/build.yml
  #- https://ci.andtechstudios.com/workflows/unity/default-branch/macos/build.yml
  #- https://ci.andtechstudios.com/workflows/unity/default-branch/linux/build.yml

Build App:
  extends: .workflows/unity/default-branch/windows/build
  #extends: .workflows/unity/default-branch/macos/build
  #extends: .workflows/unity/default-branch/linux/build

Test

Run Tests (Standard)

  • Provides continuous unit tests reports for the following:
    • Default branch pipelines
    • Merge request pipelines (where the default branch is the target)
include:
  - https://ci.andtechstudios.com/workflows/unity/test.yml

Run Tests:
  extends: .workflows/unity/test

Code Quality

Lint (Standard)

include:
  - https://ci.andtechstudios.com/workflows/unity/enforcer/lint.yml
  - https://ci.andtechstudios.com/workflows/unity/enforcer/html/lint.yml

Code Quality:
  extends: .workflows/unity/enforcer/lint

Code Quality (HTML):
  extends: .workflows/unity/enforcer/html/lint

itch.io

Deploy from Default Branch

include:
  - https://ci.andtechstudios.com/workflows/unity/itch.io/default-branch/webgl/deploy.yml
  #- https://ci.andtechstudios.com/workflows/unity/itch.io/default-branch/windows/deploy.yml
  #- https://ci.andtechstudios.com/workflows/unity/itch.io/default-branch/macos/deploy.yml
  #- https://ci.andtechstudios.com/workflows/unity/itch.io/default-branch/linux/deploy.yml

Deploy App:
  extends: .workflows/unity/itch.io/default-branch/webgl/deploy
  #extends: .workflows/unity/itch.io/default-branch/windows/deploy
  #extends: .workflows/unity/itch.io/default-branch/macos/deploy
  #extends: .workflows/unity/itch.io/default-branch/linux/deploy

Deploy on Merge Request

include:
  - https://ci.andtechstudios.com/workflows/unity/itch.io/default-branch/merge-request/webgl/deploy.yml
  #- https://ci.andtechstudios.com/workflows/unity/itch.io/default-branch/merge-request/windows/deploy.yml
  #- https://ci.andtechstudios.com/workflows/unity/itch.io/default-branch/merge-request/macos/deploy.yml
  #- https://ci.andtechstudios.com/workflows/unity/itch.io/default-branch/merge-request/linux/deploy.yml

Deploy Review App:
  extends: .workflows/unity/itch.io/default-branch/merge-request/webgl/deploy
  #extends: .workflows/unity/itch.io/default-branch/merge-request/windows/deploy
  #extends: .workflows/unity/itch.io/default-branch/merge-request/macos/deploy
  #extends: .workflows/unity/itch.io/default-branch/merge-request/linux/deploy

S3

Deploy from Default Branch

Windows
include:
  - https://ci.andtechstudios.com/workflows/unity/s3/default-branch/windows/deploy.yml

Deploy Review App:
  extends: .workflows/unity/s3/default-branch/windows/deploy
Android
include:
  - https://ci.andtechstudios.com/workflows/unity/s3/default-branch/android/deploy.yml

Deploy Review App:
  extends: .workflows/unity/s3/default-branch/android/deploy
iOS
include:
  - https://ci.andtechstudios.com/workflows/unity/fastlane/s3/default-branch/ios/deploy.yml

Deploy Review App:
  extends: .workflows/unity/fastlane/s3/default-branch/ios/deploy

Deploy on Merge Request

Android
include:
  - https://ci.andtechstudios.com/workflows/unity/s3/default-branch/merge-request/android/deploy.yml

Deploy Review App:
  extends: .workflows/unity/s3/default-branch/merge-request/android/deploy
iOS
include:
  - https://ci.andtechstudios.com/workflows/unity/fastlane/s3/default-branch/merge-request/ios/deploy.yml

Deploy Review App:
  extends: .workflows/unity/fastlane/s3/default-branch/merge-request/ios/deploy

TestFlight

Deploy from Default Branch

include:
  - https://ci.andtechstudios.com/workflows/unity/fastlane/testflight/default-branch/deploy.yml

Deploy TestFlight:
  extends: .workflows/unity/fastlane/testflight/default-branch/deploy
#  variables:
#    APP_STORE_CONNECT_USES_NON_EXEMPT_ENCRYPTION: "true"
#    APP_STORE_CONNECT_DISTRIBUTE_EXTERNAL: "true"
#    APP_STORE_CONNECT_GROUPS: "Beta" 

UPM

Deploy on Tag Push

include:
  - https://ci.andtechstudios.com/workflows/unity/upm/deploy.yml

variables:
  NODE_PROJECT_DIR: $CI_PROJECT_DIR/unity/Assets/com.example.package

Deploy Package:
  extends: .workflows/unity/upm/deploy

DocFX

Deploy from Default Branch

include:
  - https://ci.andtechstudios.com/workflows/unity/docfx/pages/build.yml

pages:
  extends: .workflows/unity/docfx/pages/build

GitLab Pages

Deploy from Default Branch

include:
  - https://ci.andtechstudios.com/workflows/unity/gitlab/pages/default-branch/webgl/deploy.yml

pages:
  extends: .workflows/unity/gitlab/pages/default-branch/webgl/deploy

Discord

Note: Create a Discord Integration before proceeding.

include:
  - https://ci.andtechstudios.com/discord/notify.yml

Send Notifications:
  extends: .discord/notify
  stage: .post

Notify after a job completes

Example Job:
  script:
    - echo "Hello world..."
  after_script:
    - !reference [.discord/notify, script]

Use a custom message format

Send Notifications:
  extends: .discord/notify
  stage: .post
  variables:
    DISCORD_MESSAGE_FORMAT: "Pipeline #${CI_PIPELINE_IID} completed succesfully"