ci: Windows self-hosted runner 단독 배포 흐름 — Docker 의존 제거

- lint/typecheck/unit-test는 태그 푸시에서 제외(allow_failure 추가)
- release-create 잡을 release-cli 도커 이미지 대신 shell+curl(Invoke-RestMethod)로 전환
- 태그 파이프라인은 package-windows → release-create 2단계, 둘 다 Windows runner에서 실행
This commit is contained in:
yunchan8804 2026-04-15 20:07:05 +09:00
parent aa65e710ec
commit 77114029a8

View file

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