stages: - check - test - package - release variables: NODE_VERSION: "20" PYTHON_VERSION: "3.11" OLLAMA_VERSION: "v0.5.7" npm_config_cache: "$CI_PROJECT_DIR/.npm" .node-cache: &node-cache cache: key: files: - package-lock.json paths: - .npm/ - node_modules/ # ──────────────────────────────────────────────────────────────────── # Docker 기반 검증 잡 — shared Docker runner가 있을 때만 동작. # MR/default 브랜치에서만 실행. 태그 푸시에서는 건너뜀(실제 배포는 package-windows). # 사내 GitLab에 Docker runner가 없으면 rules를 `when: manual`로 바꾸거나 비활성화할 것. # ──────────────────────────────────────────────────────────────────── lint: stage: check image: node:${NODE_VERSION} <<: *node-cache before_script: - npm ci --ignore-scripts script: - npm run lint rules: - if: $CI_PIPELINE_SOURCE == "merge_request_event" - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH allow_failure: true typecheck: stage: check image: node:${NODE_VERSION} <<: *node-cache before_script: - npm ci --ignore-scripts script: - npm run typecheck rules: - if: $CI_PIPELINE_SOURCE == "merge_request_event" - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH allow_failure: true unit-test: stage: test image: node:${NODE_VERSION} <<: *node-cache before_script: - npm ci --ignore-scripts script: - npm run test:unit rules: - if: $CI_PIPELINE_SOURCE == "merge_request_event" - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH allow_failure: true # ──────────────────────────────────────────────────────────────────── # Package Windows — 태그 푸시(v*) 또는 default 브랜치 수동 트리거 시 실행. # self-hosted Windows runner (shell executor, powershell shell) 필요. # 이 PC의 Node/Python/npm을 그대로 사용. # ──────────────────────────────────────────────────────────────────── package-windows: stage: package tags: - windows - shell before_script: - node --version - python --version - npm ci script: # 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 - python apps/desktop/scripts/build-sidecar.py # 2) SoX 다운로드 - powershell -ExecutionPolicy Bypass -File apps/desktop/scripts/download-sox.ps1 # 3) Ollama 다운로드 - powershell -ExecutionPolicy Bypass -File apps/desktop/scripts/download-ollama.ps1 # 4) electron-vite 빌드 + electron-builder NSIS 패키징 - npm run build --workspace=@d3ro/desktop - npm run dist --workspace=@d3ro/desktop artifacts: name: "d3ro-voice-windows-${CI_COMMIT_SHORT_SHA}" paths: - apps/desktop/release/ expire_in: 90 days expose_as: "Windows Installer" rules: - if: $CI_COMMIT_TAG =~ /^v\d+\.\d+\.\d+/ - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH when: manual allow_failure: true # ──────────────────────────────────────────────────────────────────── # Release — 같은 Windows runner에서 GitLab API를 curl로 호출해 Release 생성. # release-cli Docker 이미지 대신 shell+curl로 처리하여 Docker runner 불필요. # ──────────────────────────────────────────────────────────────────── release-create: stage: release tags: - windows - shell needs: - job: package-windows artifacts: false script: - | $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+/