d3ro-voice/.gitlab-ci.yml
Yun Chan 708e20f747
Some checks failed
CI Pipeline / Code Quality & Typecheck (push) Waiting to run
CI Pipeline / Test Suite (macos-latest) (push) Blocked by required conditions
CI Pipeline / Test Suite (ubuntu-latest) (push) Blocked by required conditions
CI Pipeline / Test Suite (windows-latest) (push) Blocked by required conditions
CI Pipeline / Build Validation (admin) (push) Blocked by required conditions
CI Pipeline / Build Validation (desktop) (push) Blocked by required conditions
Deploy Landing Page / deploy (push) Blocked by required conditions
Deploy Landing Page / build (push) Waiting to run
Release & Packaging Pipeline / Build & Publish Admin Docker Image (push) Failing after 8s
Release & Code Signing CA Pipeline / build-and-sign-windows (push) Failing after 1m51s
Build macOS / Build & Package (macOS) (push) Failing after 4s
Build macOS / Build & Package (macOS)-1 (push) Failing after 5s
Release & Code Signing CA Pipeline / build-and-sign-macos (push) Failing after 3s
Release & Packaging Pipeline / Package macOS Desktop App (push) Failing after 4s
Release & Packaging Pipeline / Package Windows Desktop App (push) Failing after 2m28s
Release & Packaging Pipeline / Publish Official GitHub Release (push) Has been skipped
feat: complete release preparation, 10+ ad mediation, CI/CD, and docker deployment
2026-08-20 11:12:05 +09:00

148 lines
5.9 KiB
YAML

# .gitlab-ci.yml
# GitLab CI/CD Pipeline for D3RO Voice
stages:
- validate
- test
- build
- package
- publish
- deploy
variables:
NODE_VERSION: "20"
PACKAGE_NAME: "d3ro-voice"
default:
image: node:20-bookworm
before_script:
- npm ci
# ────────────────────────────────────────────────────────────────────
# Validate & Lint
# ────────────────────────────────────────────────────────────────────
lint-and-typecheck:
stage: validate
script:
- npm run lint || true
- npm run typecheck
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- if: '$CI_COMMIT_BRANCH == "main" || $CI_COMMIT_BRANCH == "develop"'
- if: '$CI_COMMIT_TAG'
# ────────────────────────────────────────────────────────────────────
# Unit & Integration Tests
# ────────────────────────────────────────────────────────────────────
test-unit:
stage: test
script:
- npm test
coverage: '/All files[^|]*\|[^|]*\s+([\d\.]+)/'
artifacts:
when: always
reports:
junit: junit.xml
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- if: '$CI_COMMIT_BRANCH == "main" || $CI_COMMIT_BRANCH == "develop"'
- if: '$CI_COMMIT_TAG'
# ────────────────────────────────────────────────────────────────────
# Build Workspaces
# ────────────────────────────────────────────────────────────────────
build-workspaces:
stage: build
script:
- npm run build --workspace=@d3ro/desktop
- npm run build --workspace=@d3ro/admin
artifacts:
paths:
- apps/desktop/out/
- apps/admin/.next/
expire_in: 1 day
rules:
- if: '$CI_COMMIT_BRANCH == "main"'
- if: '$CI_COMMIT_TAG'
# ────────────────────────────────────────────────────────────────────
# Package Windows (Windows Runner)
# ────────────────────────────────────────────────────────────────────
package-windows:
stage: package
tags:
- windows
- electron
before_script:
- npm ci
script:
- npm run build --workspace=@d3ro/desktop
- cd apps/desktop
- npx electron-builder --win --x64 --config electron-builder.yml
artifacts:
name: "d3ro-voice-windows-$CI_COMMIT_TAG"
paths:
- apps/desktop/release/*/*.exe
- apps/desktop/release/*/*.blockmap
- apps/desktop/release/*/latest.yml
expire_in: 7 days
rules:
- if: '$CI_COMMIT_TAG =~ /^v\d+\.\d+\.\d+.*$/'
# ────────────────────────────────────────────────────────────────────
# Package macOS (macOS Runner)
# ────────────────────────────────────────────────────────────────────
package-macos:
stage: package
tags:
- macos
- arm64
before_script:
- npm ci
script:
- npm run build --workspace=@d3ro/desktop
- cd apps/desktop
- npx electron-builder --mac --arm64 --config electron-builder.yml
artifacts:
name: "d3ro-voice-macos-$CI_COMMIT_TAG"
paths:
- apps/desktop/release/*/*.dmg
- apps/desktop/release/*/*.zip
- apps/desktop/release/*/*.blockmap
- apps/desktop/release/*/latest-mac.yml
expire_in: 7 days
rules:
- if: '$CI_COMMIT_TAG =~ /^v\d+\.\d+\.\d+.*$/'
# ────────────────────────────────────────────────────────────────────
# Publish Release (GitLab Package Registry + Release Page)
# ────────────────────────────────────────────────────────────────────
publish-release:
stage: publish
image: node:20-bookworm
needs:
- job: package-windows
artifacts: true
- job: package-macos
artifacts: true
optional: true
script:
- node scripts/ci/publish-gitlab-release.mjs
rules:
- if: '$CI_COMMIT_TAG =~ /^v\d+\.\d+\.\d+.*$/'
# ────────────────────────────────────────────────────────────────────
# Deploy Admin Dashboard to NAS / Production Server
# ────────────────────────────────────────────────────────────────────
deploy-admin-nas:
stage: deploy
image: docker:24-cli
services:
- docker:24-dind
before_script:
- echo "$DOCKER_REGISTRY_PASSWORD" | docker login -u "$DOCKER_REGISTRY_USER" --password-stdin
script:
- docker build -t d3ro-voice-admin:latest -f Dockerfile.admin .
- docker compose -f docker-compose.prod.yml up -d admin
rules:
- if: '$CI_COMMIT_BRANCH == "main"'