diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b73b2bd..5b8e9a4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,8 +1,6 @@ stages: - check - test - - prepare - - build - package - release @@ -22,7 +20,9 @@ variables: - node_modules/ # ──────────────────────────────────────────────────────────────────── -# Check +# Docker 기반 검증 잡 — shared Docker runner가 있을 때만 동작. +# MR/default 브랜치에서만 실행. 태그 푸시에서는 건너뜀(실제 배포는 package-windows). +# 사내 GitLab에 Docker runner가 없으면 rules를 `when: manual`로 바꾸거나 비활성화할 것. # ──────────────────────────────────────────────────────────────────── lint: stage: check @@ -35,7 +35,7 @@ lint: rules: - if: $CI_PIPELINE_SOURCE == "merge_request_event" - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH - - if: $CI_COMMIT_TAG + allow_failure: true typecheck: stage: check @@ -48,11 +48,8 @@ typecheck: rules: - if: $CI_PIPELINE_SOURCE == "merge_request_event" - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH - - if: $CI_COMMIT_TAG + allow_failure: true -# ──────────────────────────────────────────────────────────────────── -# Test -# ──────────────────────────────────────────────────────────────────── unit-test: stage: test image: node:${NODE_VERSION} @@ -64,26 +61,24 @@ unit-test: rules: - if: $CI_PIPELINE_SOURCE == "merge_request_event" - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH + allow_failure: true # ──────────────────────────────────────────────────────────────────── -# Package Windows (태그 푸시 또는 수동 트리거 시만 실행) -# - PyInstaller sidecar 빌드 → SoX/Ollama 다운로드 → electron-builder --win -# - Windows self-hosted runner 필요 (native 모듈 + PyInstaller 네이티브 빌드) +# Package Windows — 태그 푸시(v*) 또는 default 브랜치 수동 트리거 시 실행. +# self-hosted Windows runner (shell executor, powershell shell) 필요. +# 이 PC의 Node/Python/npm을 그대로 사용. # ──────────────────────────────────────────────────────────────────── package-windows: stage: package tags: - windows - - shell # self-hosted Windows runner (shell executor) - variables: - CI_RUNNER_PROTECTED: "false" + - shell before_script: - # Node 20 + Python 3.11이 러너에 사전 설치되어 있어야 함 - node --version - python --version - npm ci script: - # 1) Python sidecar 의존성 설치 + PyInstaller 빌드 + # 1) Python sidecar 의존성 + PyInstaller 빌드 - python -m pip install --upgrade pip - python -m pip install pyinstaller - python -m pip install -r apps/desktop/sidecar/requirements.txt @@ -108,31 +103,30 @@ package-windows: allow_failure: true # ──────────────────────────────────────────────────────────────────── -# Release (태그 시 GitLab Releases 페이지에 자동 첨부) +# Release — 같은 Windows runner에서 GitLab API를 curl로 호출해 Release 생성. +# release-cli Docker 이미지 대신 shell+curl로 처리하여 Docker runner 불필요. # ──────────────────────────────────────────────────────────────────── release-create: stage: release - image: registry.gitlab.com/gitlab-org/release-cli:latest + tags: + - windows + - shell needs: - job: package-windows - artifacts: true + artifacts: false script: - - echo "Creating GitLab Release for tag $CI_COMMIT_TAG" - release: - name: "D3RO Voice $CI_COMMIT_TAG" - tag_name: "$CI_COMMIT_TAG" - description: | - ## D3RO Voice $CI_COMMIT_TAG - - Windows 설치 파일은 **Job artifacts**에서 다운로드하거나 아래 링크에서 받을 수 있습니다. - - - 기본 LLM 모델: `gemma4:e4b` (첫 실행 시 자동 다운로드, ~9.6GB) - - Whisper 모델: `large-v3` (첫 실행 시 자동 다운로드, ~3GB) - - VC++ 재배포 패키지 선행 설치 필요 (설치 마법사에서 안내) - assets: - links: - - name: "Windows Installer (artifacts)" - url: "$CI_PROJECT_URL/-/jobs/artifacts/$CI_COMMIT_TAG/browse/apps/desktop/release?job=package-windows" - link_type: package + - | + $artifactUrl = "$env:CI_PROJECT_URL/-/jobs/artifacts/$env:CI_COMMIT_TAG/download?job=package-windows" + $description = "## D3RO Voice $env:CI_COMMIT_TAG`n`nWindows 설치 파일은 [package-windows 잡 artifacts]($artifactUrl)에서 받을 수 있습니다.`n`n- 기본 LLM 모델: ``gemma4:e4b`` (첫 실행 시 자동 다운로드, ~9.6GB)`n- Whisper 모델: ``large-v3`` (첫 전사 시 자동 다운로드, ~3GB)`n- 설치 마법사가 Visual C++ 재배포 패키지를 자동 다운로드/설치" + $body = @{ + name = "D3RO Voice $env:CI_COMMIT_TAG" + tag_name = "$env:CI_COMMIT_TAG" + description = $description + } | ConvertTo-Json -Compress + Invoke-RestMethod ` + -Uri "$env:CI_API_V4_URL/projects/$env:CI_PROJECT_ID/releases" ` + -Method Post ` + -Headers @{ "JOB-TOKEN" = "$env:CI_JOB_TOKEN" ; "Content-Type" = "application/json" } ` + -Body $body rules: - if: $CI_COMMIT_TAG =~ /^v\d+\.\d+\.\d+/