이 튜토리얼은 GitLab CI에 초점을 맞추고 있지만, 다른 CI/CD 플랫폼에 적응하기 위해 약간의 조정을 통해 사용할 수 있습니다.
소개
앱을 Capgo에 먼저 등록했는지 확인하세요. 이 튜토리얼은 업로드 단계만 다룹니다.
커밋 규칙
첫 번째로 커밋 규칙을 따라야 합니다. context: Capgo Builder / native cloud build product page. Role: Short UI label or navigation item. Message key `native_build_builder_credit_first` (Native Build Builder Credit First).표준 커밋

GitLab CI 태그
그 다음에 GitLab을 자동으로 빌드하고 태그를 생성하기 위해 첫 번째 GitLab을 만들 필요가 있습니다.
다음 경로에 파일을 생성하세요: .github/workflows/bump_version.yml
다음 내용으로 파일을 생성하세요:
name: Bump version
on:
push:
branches:
- main
jobs:
bump-version:
if: "!startsWith(github.event.head_commit.message, 'chore(release):')"
runs-on: ubuntu-latest
name: "Bump version and create changelog with standard version"
steps:
- name: Check out
uses: actions/checkout@v6
with:
fetch-depth: 0
filter: blob:none
token: '${{ secrets.PERSONAL_ACCESS_TOKEN }}'
- name: Git config
run: |
git config --local user.name "github-actions[bot]"
git config --local user.email "github-actions[bot]@users.noreply.github.com"
- name: Create bump and changelog
run: npx capacitor-standard-version
- name: Push to origin
run: |
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
remote_repo="https://${GITHUB_ACTOR}:${{ secrets.PERSONAL_ACCESS_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git"
git pull $remote_repo $CURRENT_BRANCH
git push $remote_repo HEAD:$CURRENT_BRANCH --follow-tags --tags
이 작업은 당신의 main branch에서 모든 커밋에 대한 태그를 릴리즈하고 main branch의 커밋에 대한 changelog 항목을 추가합니다. CHANGELOG.md.
이 파일이 없다고 걱정하지 마세요. 이 파일은 당신에게 자동으로 생성됩니다.
이 기능을 사용하려면 GitLab CI/CD 변수에 개인 접근 토큰을 추가해야 합니다. 개인 접근 토큰 CI가 changelog를 커밋할 수 있도록 하기 위해 필요합니다. PERSONAL_ACCESS_TOKEN.
토큰을 생성할 때 만료 기간을
으로 설정하고 범위는 never 로 선택하세요. repo.
버전이 저장된 위치를 이해하도록 도구를 사용하려면, 당신의 저장소의 루트에 .cz.toml 파일을 생성해야 합니다.
내용은 다음과 같습니다:
[tool.commitizen]
name = "cz_conventional_commits"
tag_format = "$major.$minor.$patch$prerelease"
version = "0.11.5"
version_files = [
"package.json:version",
".cz.toml"
]
이 파일의 버전을 당신의 저장소에 있는 버전과 동일하게 설정하세요. package.json 파일.
처음에는 필요하지만, 이후에는 도구가 자동으로 업데이트합니다.
GitHub에 첫 번째 태그가 나타날 수 있습니다.
GitHub 빌드 작업
__CAPGO_KEEP_0__ 경로에 파일을 생성하세요. .github/workflows/build.yml
__CAPGO_KEEP_0__ 내용:
name: Build source code and send to Capgo
on:
push:
tags:
- '*'
jobs:
deploy:
runs-on: ubuntu-latest
name: "Build code and release"
steps:
- name: Check out
uses: actions/checkout@v6
- name: Install dependencies
id: install_code
run: npm i
- name: Build
id: build_code
run: npm run build
env: # Remove both lines if you don't need it
FIREBASE_CONFIG: ${{ secrets.FIREBASE_CONFIG }} # Example of env var coming from a secret
- name: Create Release
id: create_release
run: npx @capgo/cli@latest bundle upload -a ${{ secrets.CAPGO_TOKEN }} -c production
Capgo에 의존성을 설치하고 빌드한 후 Capgo로 전송합니다.
__CAPGO_KEEP_0__ 빌드 명령이 다르다면, __CAPGO_KEEP_0__ 단계에서 변경할 수 있습니다. build_code __CAPGO_KEEP_0__ 키를 __CAPGO_KEEP_1__에서 가져와 __CAPGO_KEEP_0__ 저장소의 __CAPGO_KEEP_0__ 비밀에 추가하세요.
To make this work, you need to get your API key for Capgo, add it in the GitHub __CAPGO_KEEP_1__ CAPGO_TOKEN.
이제 이 두 파일을 커밋하고 GitHub에 첫 번째 태그가 나타날 수 있습니다!
생산 채널에 대한 새로운 빌드를 생성하는 데 커밋을 추가합니다.
빌드 단계에서 테스트를 추가하여 code이 작동하는지 확인해야 합니다.
Capgo 대시보드로 이동하여 빌드가 나타났는지 확인하고 이제 CI/CD 시스템이 있습니다.
사용자들이 업데이트가 사용 가능한 경우 언제든지 업데이트를 받을 수 있도록 하려면 채널로 이동하여 __CAPGO_KEEP_0__ public.
자동 빌드 및 릴리스와 Gitlab
Gitlab을 사용하여 CI/CD 자동화 계획을 만든다면 __CAPGO_KEEP_0__ CI/CD __CAPGO_KEEP_0__ CI/CD에서 __CAPGO_KEEP_0__ CI/CD __CAPGO_KEEP_0__ 네이티브 빌드 Capgo CI/CD for the product workflow in Capgo CI/CD, Capgo CI/CD for the product workflow in Capgo Native Builds, Capgo Integrations for the product workflow in Capgo Integrations, Capgo CI/CD Integration Capgo Actions Integration GitHub Actions Integration for the implementation detail in GitHub Actions Integration.