name: Build Pre-Release
on:
push:
tags:
- 'v*-pre'
- 'v*-alpha'
- 'v*-beta'
- 'v*-rc*'
workflow_dispatch:
inputs:
version:
description: 'Version tag for pre-release (e.g., v0.5.1-pre)'
required: true
jobs:
build-nsis:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20.12.2'
- name: Set Package Version
id: version
run: |
try {
if ("${{ github.event.inputs.version }}" -ne "") {
$version = "${{ github.event.inputs.version }}"
Write-Host "β Using manual input version: $version"
} elseif ("${{ github.ref_type }}" -eq "tag") {
$version = "${{ github.ref_name }}"
Write-Host "β Using tag version: $version"
} else {
Write-Host "π Reading version from package.json..."
$packageJson = Get-Content package.json -Raw | ConvertFrom-Json
$packageVersion = $packageJson.version
$version = "v$packageVersion-pre"
Write-Host "β Using package.json version: $version"
}
Write-Host "π― Final PACKAGE_VERSION: $version"
echo "PACKAGE_VERSION=$version" >> $env:GITHUB_ENV
echo "version=$version" >> $env:GITHUB_OUTPUT
} catch {
Write-Error "β Failed to determine package version: $($_.Exception.Message)"
exit 1
}
- name: Install workspace dependencies (CI)
run: npm ci --workspaces --include-workspace-root
- name: Build shared types
run: npm run build --workspace=shared
- name: Build MCP Server (Bundled)
run: npm run build:bundle --workspace=packages/mcp-server
- name: Setup NSIS
run: choco install nsis -y
- name: Build NSIS Installer
run: |
$env:PATH = "C:\Program Files (x86)\NSIS;$env:PATH"
cd installer
node build-nsis.js --version $env:PACKAGE_VERSION
- name: Create Foundry Module ZIP
run: |
Write-Host "π¦ Creating Foundry module ZIP for testing..."
cd packages/foundry-module
$compress = @{
Path = Get-ChildItem -Path "." -Exclude ".*", "node_modules"
DestinationPath = "..\..\foundry-vtt-mcp.zip"
CompressionLevel = "Optimal"
}
Compress-Archive @compress -Force
if (Test-Path "..\..\foundry-vtt-mcp.zip") {
$size = (Get-Item "..\..\foundry-vtt-mcp.zip").Length / 1KB
Write-Host "β Foundry module ZIP created ($([math]::Round($size, 1)) KB)"
} else {
Write-Host "β Foundry module ZIP creation failed"
exit 1
}
- name: Create Standalone MCP Server ZIP
run: |
Write-Host "π¦ Creating standalone MCP server ZIP..."
$standalonePath = "standalone-mcp-server"
New-Item -ItemType Directory -Force -Path $standalonePath
Copy-Item "packages\mcp-server\dist\index.bundle.cjs" "$standalonePath\index.js"
$standalonePackage = @{
name = "foundry-mcp-server"
version = "${{ env.PACKAGE_VERSION }}".TrimStart('v')
description = "Foundry VTT MCP Server - Standalone Installation (PRE-RELEASE)"
main = "index.js"
scripts = @{
start = "node index.js"
}
engines = @{
node = ">=18.0.0"
}
} | ConvertTo-Json -Depth 3
$standalonePackage | Out-File -FilePath "$standalonePath\package.json" -Encoding UTF8
$readmeLines = @(
"# Foundry MCP Server - Manual Installation (PRE-RELEASE)",
"",
"β οΈ **This is a pre-release version for testing purposes.**",
"",
"This package contains the standalone MCP server for manual installation on any platform.",
"",
"## Requirements",
"- Node.js 18.0.0 or later",
"- Foundry VTT with MCP Bridge module installed",
"",
"## Installation",
"1. Extract this ZIP to your desired location",
"2. Run: npm start or node index.js",
"3. Configure Claude Desktop to connect to this server",
"4. Install the MCP Bridge module in Foundry VTT",
"",
"For full documentation visit: https://github.com/adambdooley/foundry-vtt-mcp",
"",
"Version: ${{ env.PACKAGE_VERSION }}"
)
$readmeLines | Out-File -FilePath "$standalonePath\README.md" -Encoding UTF8
$compress = @{
Path = $standalonePath
DestinationPath = "foundry-mcp-server-${{ env.PACKAGE_VERSION }}.zip"
CompressionLevel = "Optimal"
}
Compress-Archive @compress -Force
if (Test-Path "foundry-mcp-server-${{ env.PACKAGE_VERSION }}.zip") {
$size = (Get-Item "foundry-mcp-server-${{ env.PACKAGE_VERSION }}.zip").Length / 1KB
Write-Host "β Standalone MCP server ZIP created ($([math]::Round($size, 1)) KB)"
} else {
Write-Host "β Standalone MCP server ZIP creation failed"
exit 1
}
Remove-Item -Recurse -Force $standalonePath
- name: Verify installer package
run: |
cd installer/build
dir
if (Test-Path "FoundryMCPServer-Setup-$env:PACKAGE_VERSION.exe") {
Write-Host "β NSIS installer found"
$size = (Get-Item "FoundryMCPServer-Setup-$env:PACKAGE_VERSION.exe").Length / 1MB
Write-Host "π Installer size: $([math]::Round($size, 1)) MB"
} else {
Write-Host "β NSIS installer not found"
exit 1
}
- name: Upload installer as artifact
uses: actions/upload-artifact@v4
with:
name: foundry-mcp-server-installer-${{ env.PACKAGE_VERSION }}
path: installer/build/FoundryMCPServer-Setup-${{ env.PACKAGE_VERSION }}.exe
retention-days: 30
- name: Create Pre-Release with All Assets
if: startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch'
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ env.PACKAGE_VERSION }}
name: Foundry MCP Server ${{ env.PACKAGE_VERSION }} (Pre-Release)
body: |
## β οΈ Pre-Release: Foundry MCP Server ${{ env.PACKAGE_VERSION }}
**This is a pre-release version for testing purposes. Use at your own risk.**
### π§ͺ Testing Features
This pre-release includes new features that need testing before official release:
- Remote Foundry VTT support with WSS protocol
- Auto protocol detection (http β ws, https β wss)
- Remote ComfyUI support for distributed GPU processing
- Module settings UI with Auto/Local/Remote dropdown
### π¦ Installation Options
**Windows Users (Recommended):**
- Download `FoundryMCPServer-Setup-${{ env.PACKAGE_VERSION }}.exe`
- Run installer (no admin rights required)
**Manual Installation (All Platforms):**
- Download `foundry-mcp-server-${{ env.PACKAGE_VERSION }}.zip`
- Extract and run with Node.js 18+
**Foundry VTT Module:**
- Download `foundry-vtt-mcp.zip`
- Install manually in Foundry VTT
### π Testing Checklist
Please test and report issues:
- [ ] Local Foundry + Local MCP (same machine)
- [ ] Remote Foundry over HTTP (ws://)
- [ ] Remote Foundry over HTTPS (wss://)
- [ ] Remote ComfyUI server
- [ ] Auto protocol detection
**Report issues at:** https://github.com/adambdooley/foundry-vtt-mcp/issues
For full documentation, visit: https://github.com/adambdooley/foundry-vtt-mcp
files: |
installer/build/FoundryMCPServer-Setup-${{ env.PACKAGE_VERSION }}.exe
foundry-vtt-mcp.zip
foundry-mcp-server-${{ env.PACKAGE_VERSION }}.zip
packages/foundry-module/module.json
generate_release_notes: true
draft: false
prerelease: true