Files
Ned HellerandClaude Opus 4.5 33322c77a0 Fix deploy to use correct SMB share mount
- Use net use with \192.168.100.22\releases and credentials
- Deploy to R:\$CI_PROJECT_NAME\$CI_COMMIT_REF_NAME
- Clean up drive mapping after deploy
- Manual trigger on main branch

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 21:47:05 -08:00

77 lines
2.8 KiB
YAML

stages:
- build
- package
- deploy
variables:
DOTNET_VERSION: "8.0"
PROJECT_YODA: "src/YodaStoriesNG.Engine/YodaStoriesNG.Engine.csproj"
PROJECT_INDY: "src/IndyNG.Engine/IndyNG.Engine.csproj"
# Build all platforms on Windows runner
build:
stage: build
tags:
- win10
- shell
before_script:
- $env:PATH = "C:\Program Files\dotnet;$env:PATH"
script:
- dotnet restore
# Windows x64
- dotnet publish $env:PROJECT_YODA -c Release -r win-x64 --self-contained true -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true -o publish/windows/YodaStoriesNG
- dotnet publish $env:PROJECT_INDY -c Release -r win-x64 --self-contained true -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true -o publish/windows/IndyNG
# Linux x64
- dotnet publish $env:PROJECT_YODA -c Release -r linux-x64 --self-contained true -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true -o publish/linux/YodaStoriesNG
- dotnet publish $env:PROJECT_INDY -c Release -r linux-x64 --self-contained true -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true -o publish/linux/IndyNG
# macOS x64
- dotnet publish $env:PROJECT_YODA -c Release -r osx-x64 --self-contained true -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true -o publish/macos/YodaStoriesNG
- dotnet publish $env:PROJECT_INDY -c Release -r osx-x64 --self-contained true -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true -o publish/macos/IndyNG
artifacts:
paths:
- publish/
expire_in: 1 week
# Package all builds into zips
package:
stage: package
tags:
- win10
- shell
needs:
- build
script:
- $VERSION = Get-Date -Format "yyyyMMdd-HHmmss"
# Create Windows zip
- Compress-Archive -Path publish/windows/* -DestinationPath "YodaStoriesNG-windows-x64-$VERSION.zip"
# Create Linux zip
- Compress-Archive -Path publish/linux/* -DestinationPath "YodaStoriesNG-linux-x64-$VERSION.zip"
# Create macOS zip
- Compress-Archive -Path publish/macos/* -DestinationPath "YodaStoriesNG-macos-x64-$VERSION.zip"
- Get-ChildItem *.zip
artifacts:
paths:
- "*.zip"
expire_in: 1 month
# Deploy to network share
deploy:
stage: deploy
tags:
- win10
- shell
needs:
- package
script:
- 'net use R: \\192.168.100.22\releases gitlab /user:root'
- 'New-Item -ItemType Directory -Force -Path "R:\$env:CI_PROJECT_NAME\$env:CI_COMMIT_REF_NAME"'
- 'Copy-Item -Path *.zip -Destination "R:\$env:CI_PROJECT_NAME\$env:CI_COMMIT_REF_NAME" -Force'
- 'Get-ChildItem "R:\$env:CI_PROJECT_NAME\$env:CI_COMMIT_REF_NAME"'
- 'net use R: /delete'
rules:
- if: $CI_COMMIT_TAG
- if: $CI_PIPELINE_SOURCE == "web"
- if: $CI_COMMIT_BRANCH == "main"
when: manual
allow_failure: true