Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/cd-deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_dispatch:
inputs:
version:
description: 'Version (e.g. v1.0, v1.1)'
description: 'Version (e.g. v1.0, v1.1, v2.0.0-beta.1)'
required: true

concurrency:
Expand Down Expand Up @@ -49,7 +49,7 @@ jobs:
-H "Authorization: Bearer $KEY" \
-H "Content-Type: application/zip" \
--data-binary @$GITHUB_WORKSPACE/docs.zip \
"${URL}/api/products/shelf/versions/${VER}"
"${URL}/_api/products/shelf/versions/${VER}"

- name: Deployment summary
run: |
Expand Down
27 changes: 21 additions & 6 deletions .github/workflows/cd-deploy-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ jobs:
exit 1
fi

if [[ ! "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "::error ::Invalid release version format. Expected X.Y.Z (e.g., 1.2.3), got: $VERSION"
if [[ ! "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-.+)?$ ]]; then
echo "::error ::Invalid release version format. Expected X.Y.Z or X.Y.Z-label (e.g., 1.2.3, 1.2.3-beta.1), got: $VERSION"
exit 1
fi

Expand Down Expand Up @@ -69,6 +69,15 @@ jobs:
--password ${{ secrets.PERSONAL_PACKAGES_TOKEN }} \
--store-password-in-clear-text

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22

- name: Build Admin UI
working-directory: ./src/Cocoar.Shelf.Client
run: npm ci && npm run build

- name: Restore dependencies
run: dotnet restore Cocoar.Shelf.slnx
working-directory: ./src
Expand Down Expand Up @@ -196,9 +205,15 @@ jobs:
env:
VERSION: ${{ needs.validate-version.outputs.version }}
run: |
MAJOR=$(echo "$VERSION" | cut -d. -f1)
MINOR=$(echo "$VERSION" | cut -d. -f2)
echo "value=v${MAJOR}.${MINOR}" >> $GITHUB_OUTPUT
if [[ "$VERSION" == *-* ]]; then
# Pre-release: use full version (e.g. v6.0.0-beta.1)
echo "value=v${VERSION}" >> $GITHUB_OUTPUT
else
# Stable: use major.minor (e.g. v5.2)
MAJOR=$(echo "$VERSION" | cut -d. -f1)
MINOR=$(echo "$VERSION" | cut -d. -f2)
echo "value=v${MAJOR}.${MINOR}" >> $GITHUB_OUTPUT
fi

- name: Upload to Shelf
env:
Expand All @@ -211,7 +226,7 @@ jobs:
-H "Authorization: Bearer $KEY" \
-H "Content-Type: application/zip" \
--data-binary @$GITHUB_WORKSPACE/docs.zip \
"${URL}/api/products/shelf/versions/${VER}"
"${URL}/_api/products/shelf/versions/${VER}"

- name: Docs deployment summary
run: |
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/cd-deploy-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,15 @@ jobs:
--password ${{ secrets.PERSONAL_PACKAGES_TOKEN }} \
--store-password-in-clear-text

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22

- name: Build Admin UI
working-directory: ./src/Cocoar.Shelf.Client
run: npm ci && npm run build

- name: Restore dependencies
run: dotnet restore Cocoar.Shelf.slnx
working-directory: ./src
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/ci-develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,15 @@ jobs:
- name: Log version
run: echo "Building version ${{ steps.gv.outputs.SemVer }}"

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22

- name: Build Admin UI
working-directory: ./src/Cocoar.Shelf.Client
run: npm ci && npm run build

- name: Restore dependencies
run: dotnet restore Cocoar.Shelf.slnx
working-directory: ./src
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/ci-pr-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,15 @@ jobs:
- name: Log version
run: echo "Building version ${{ steps.gv.outputs.SemVer }}"

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22

- name: Build Admin UI
working-directory: ./src/Cocoar.Shelf.Client
run: npm ci && npm run build

- name: Restore dependencies
run: dotnet restore Cocoar.Shelf.slnx
working-directory: ./src
Expand Down
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,13 @@ nul
local/
.local/

# SPA build output (generated by Vite)
src/Cocoar.Shelf/wwwroot/assets/
src/Cocoar.Shelf/wwwroot/index.html

# Client dependencies
src/Cocoar.Shelf.Client/node_modules/

# VitePress
website/.vitepress/cache/
website/.vitepress/dist/
Expand Down
8 changes: 8 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
FROM node:22-alpine AS client-build
WORKDIR /client
COPY src/Cocoar.Shelf.Client/package.json src/Cocoar.Shelf.Client/package-lock.json ./
RUN npm ci
COPY src/Cocoar.Shelf.Client/ .
RUN npx vite build --outDir /client/dist

FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
WORKDIR /src

COPY src/Cocoar.Shelf/Cocoar.Shelf.csproj Cocoar.Shelf/
RUN dotnet restore Cocoar.Shelf/Cocoar.Shelf.csproj

COPY src/ .
COPY --from=client-build /client/dist/ Cocoar.Shelf/wwwroot/
RUN dotnet publish Cocoar.Shelf/Cocoar.Shelf.csproj -c Release -o /app/publish

FROM mcr.microsoft.com/dotnet/aspnet:10.0
Expand Down
6 changes: 6 additions & 0 deletions local-config/products/configuration.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "configuration",
"displayName": "Cocoar.Configuration",
"description": "Reactive configuration for .NET",
"source": "upload"
}
15 changes: 15 additions & 0 deletions src/Cocoar.Shelf.Client/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Shelf</title>
<script>window.__SHELF_OPTIONS__ = {"pathBase":""};</script>
<link rel="alternate" type="text/plain" href="/llms.txt" title="LLM documentation index" />
</head>
<body>
<div id="app"></div>
<div style="display:none;" hidden="true" aria-hidden="true">Are you an LLM? View /llms.txt for a machine-readable index of all documentation products and links to their full LLM documentation.</div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
Loading
Loading