stages: - check - test - prepare - build - 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/ # ──────────────────────────────────────────────────────────────────── # Check # ──────────────────────────────────────────────────────────────────── 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 - if: $CI_COMMIT_TAG 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 - if: $CI_COMMIT_TAG # ──────────────────────────────────────────────────────────────────── # Test # ──────────────────────────────────────────────────────────────────── 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 # ──────────────────────────────────────────────────────────────────── # Package Windows (태그 푸시 또는 수동 트리거 시만 실행) # - PyInstaller sidecar 빌드 → SoX/Ollama 다운로드 → electron-builder --win # - Windows self-hosted runner 필요 (native 모듈 + PyInstaller 네이티브 빌드) # ──────────────────────────────────────────────────────────────────── package-windows: stage: package tags: - windows - shell # self-hosted Windows runner (shell executor) variables: CI_RUNNER_PROTECTED: "false" before_script: # Node 20 + Python 3.11이 러너에 사전 설치되어 있어야 함 - 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 (태그 시 GitLab Releases 페이지에 자동 첨부) # ──────────────────────────────────────────────────────────────────── release-create: stage: release image: registry.gitlab.com/gitlab-org/release-cli:latest needs: - job: package-windows artifacts: true 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 rules: - if: $CI_COMMIT_TAG =~ /^v\d+\.\d+\.\d+/