지속적 통합(CI)
지속적 통합](https://en.wikipedia.org/wiki/Continuous_integration) 워크플로에서 Tuist 명령을 실행하려면 CI 환경에 설치해야 합니다.
인증은 선택 사항이지만 cache와 같은 서버 측 기능을 사용하려는 경우 필수입니다.
다음 섹션에서는 다양한 CI 플랫폼에서 이 작업을 수행하는 방법에 대한 예를 제공합니다.
예제
GitHub 액션
GitHub 작업](https://docs.github.com/en/actions)에서
OIDC 인증을 사용하여 안전하고 비밀 없는 인증을 할 수 있습니다:yaml
name: Build Application
on:
pull_request:
branches:
- main
push:
branches:
- main
permissions:
id-token: write
contents: read
jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: jdx/mise-action@v2
- run: tuist auth login
- run: tuist setup cacheyaml
name: Build Application
on:
pull_request:
branches:
- main
push:
branches:
- main
permissions:
id-token: write
contents: read
jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- run: brew install --formula [email protected]
- run: tuist auth login
- run: tuist setup cacheyaml
name: Build Application
on:
pull_request:
branches:
- main
push:
branches:
- main
env:
TUIST_TOKEN: ${{ secrets.TUIST_TOKEN }}
jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: jdx/mise-action@v2
- run: tuist setup cacheyaml
name: Build Application
on:
pull_request:
branches:
- main
push:
branches:
- main
env:
TUIST_TOKEN: ${{ secrets.TUIST_TOKEN }}
jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- run: brew install --formula [email protected]
- run: tuist setup cacheOIDC 설정
OIDC 인증을 사용하기 전에
GitHub 저장소를 Tuist 프로젝트에 연결해야 합니다. OIDC가 작동하려면권한: id-token: write 권한이필요합니다. 또는 TUIST_TOKEN 시크릿과 함께
TIP
여러 환경에 걸쳐 Tuist 버전을 고정하려면 Tuist 프로젝트에서 mise use --pin 을 사용하는 것이 좋습니다. 이 명령은 Tuist의 버전이 포함된 .tool-versions 파일을 생성합니다.
Xcode 클라우드
Xcode 프로젝트를 소스로 사용하는 Xcode Cloud에서 post-clone 스크립트를 추가하여 Tuist를 설치하고 필요한 명령(예: tuist generate)을 실행해야 합니다:
bash
#!/bin/sh
# Mise installation taken from https://mise.jdx.dev/continuous-integration.html#xcode-cloud
curl https://mise.run | sh # Install Mise
export PATH="$HOME/.local/bin:$PATH"
mise install # Installs the version from .mise.toml
# Runs the version of Tuist indicated in the .mise.toml file {#runs-the-version-of-tuist-indicated-in-the-misetoml-file}
mise exec -- tuist install --path ../ # `--path` needed as this is run from within the `ci_scripts` directory
mise exec -- tuist generate -p ../ --no-open # `-p` needed as this is run from within the `ci_scripts` directorybash
#!/bin/sh
brew install --formula [email protected]
tuist generate정보 인증::: info 인증
프로젝트 토큰을 사용하려면 Xcode 클라우드 워크플로 설정에서TUIST_TOKEN 환경 변수를설정합니다.
:::
CircleCI
CircleCI](https://circleci.com)에서는
OIDC 인증을 사용하여 비밀 없는 안전한 인증을 할 수 있습니다:yaml
version: 2.1
jobs:
build:
macos:
xcode: "15.0.1"
steps:
- checkout
- run:
name: Install Mise
command: |
curl https://mise.jdx.dev/install.sh | sh
echo 'export PATH="$HOME/.local/bin:$PATH"' >> $BASH_ENV
- run:
name: Install Tuist
command: mise install
- run:
name: Authenticate
command: mise exec -- tuist auth login
- run:
name: Build
command: mise exec -- tuist setup cacheyaml
version: 2.1
jobs:
build:
macos:
xcode: "15.0.1"
environment:
TUIST_TOKEN: $TUIST_TOKEN
steps:
- checkout
- run:
name: Install Mise
command: |
curl https://mise.jdx.dev/install.sh | sh
echo 'export PATH="$HOME/.local/bin:$PATH"' >> $BASH_ENV
- run:
name: Install Tuist
command: mise install
- run:
name: Build
command: mise exec -- tuist setup cache정보 인증::: info 인증
OIDC 인증을 사용하기 전에
GitHub 저장소를 Tuist 프로젝트에 연결해야 합니다. CircleCI OIDC 토큰에는 연결된 GitHub 저장소가 포함되며, 이 저장소는Tuist에서 프로젝트에 대한 접근 권한을 부여하는 데 사용됩니다. 또는
프로젝트 토큰을TUIST_TOKEN 환경 변수와 함께 사용할 수 있습니다. :::
Bitrise
Bitrise](https://bitrise.io)에서는
OIDC 인증을 사용하여 비밀 없는 안전한 인증을 할 수 있습니다:yaml
workflows:
build:
steps:
- git-clone@8: {}
- script@1:
title: Install Mise
inputs:
- content: |
curl https://mise.jdx.dev/install.sh | sh
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
- script@1:
title: Install Tuist
inputs:
- content: mise install
- get-identity-token@0:
inputs:
- audience: tuist
- script@1:
title: Authenticate
inputs:
- content: mise exec -- tuist auth login
- script@1:
title: Build
inputs:
- content: mise exec -- tuist setup cacheyaml
workflows:
build:
steps:
- git-clone@8: {}
- script@1:
title: Install Mise
inputs:
- content: |
curl https://mise.jdx.dev/install.sh | sh
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
- script@1:
title: Install Tuist
inputs:
- content: mise install
- script@1:
title: Build
inputs:
- content: mise exec -- tuist setup cache정보 인증::: info 인증
OIDC 인증을 사용하기 전에
GitHub 저장소를 Tuist 프로젝트에 연결해야 합니다. Bitrise OIDC 토큰에는 연결된 GitHub 저장소가 포함되며, 이 저장소는Tuist에서 프로젝트에 대한 접근 권한을 부여하는 데 사용됩니다. 또는
프로젝트 토큰을TUIST_TOKEN 환경 변수와 함께 사용할 수 있습니다. :::
코드매직
코드매직](https://codemagic.io)에서 워크플로에 추가 단계를 추가하여 Tuist를 설치할 수 있습니다:
yaml
workflows:
build:
name: Build
max_build_duration: 30
environment:
xcode: 15.0.1
vars:
TUIST_TOKEN: ${{ secrets.TUIST_TOKEN }}
scripts:
- name: Install Mise
script: |
curl https://mise.jdx.dev/install.sh | sh
mise install # Installs the version from .mise.toml
- name: Build
script: mise exec -- tuist setup cacheyaml
workflows:
build:
name: Build
max_build_duration: 30
environment:
xcode: 15.0.1
vars:
TUIST_TOKEN: ${{ secrets.TUIST_TOKEN }}
scripts:
- name: Install Tuist
script: |
brew install --formula [email protected]
- name: Build
script: tuist setup cache정보 인증::: info 인증
프로젝트 토큰을 생성하고TUIST_TOKEN 이라는 이름의 비밀 환경 변수로 추가합니다. :::
