필수 사전지식

GitHub Action

Getting started

필요한 것

Unity - Activation

Setting up a workflow

action을 사용할 github repository의 탭메뉴에서 actions에 들어가 new workflow 버튼을 클릭하고

.github/workflows/main.yml 파일을 생성, 아래 순서대로 setting해주면 된다.

  1. Checkout your repository using Checkout.
  2. Cache Unity Library folder using Cache.
  3. Configure your test job using Test Runner.
  4. Configure your build job using Builder.
  5. Deploy your application.

Simple Example

name: Actions 😎

on: [push, pull_request]

jobs:
  build:
    name: Build my project ✨
    runs-on: ubuntu-latest
    steps:
      # Checkout
      - name: Checkout repository
        uses: actions/checkout@v2
        with:
          lfs: true

      # Cache
      - uses: actions/cache@v2
        with:
          path: Library
          key: Library

      # Test
      - name: Run tests
        uses: game-ci/unity-test-runner@v2
        env:
          UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
        with:
          githubToken: ${{ secrets.GITHUB_TOKEN }}

      # Build
      - name: Build project
        uses: game-ci/unity-builder@v2
        env:
          UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
        with:
          targetPlatform: WebGL

      # Output
      - uses: actions/upload-artifact@v2
        with:
          name: Build
          path: build

Advanced Example