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
9 changes: 5 additions & 4 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
"version": 1,
"isRoot": true,
"tools": {
"docfx": {
"version": "2.78.4",
"lunet": {
"version": "1.0.10",
"commands": [
"docfx"
]
"lunet"
],
"rollForward": false
}
}
}
11 changes: 5 additions & 6 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# GitHub Actions Workflows

Workflow files for continuous integration and delivery will be authored here. Planned pipelines include:

- PR validation across Windows, macOS, and Linux.
- Native artifact packaging per architecture.
- Managed library build, test, and publish.
- Documentation generation and deployment.
This repository uses GitHub Actions for:

- cross-platform native and managed validation in `ci.yml`
- reusable native build orchestration in `native-build.yml`
- Lunet documentation publishing in `docs.yml`
- tagged release packaging in `release.yml`
20 changes: 19 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,24 @@ on:
pull_request:

jobs:
docs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup .NET SDKs
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
10.0.x
8.0.x

- name: Validate docs build
run: |
chmod +x check-docs.sh
./check-docs.sh

native-linux:
uses: ./.github/workflows/native-build.yml
with:
Expand All @@ -30,7 +48,7 @@ jobs:
native-macos-x64:
uses: ./.github/workflows/native-build.yml
with:
runner: macos-13
runner: macos-15-intel
configuration: Release
artifact-name: native-macos-x64

Expand Down
19 changes: 8 additions & 11 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,22 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Setup .NET
- name: Setup .NET SDKs
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
dotnet-version: |
10.0.x
8.0.x

- name: Build documentation
run: |
./docs/build-docs.sh

- name: Upload site
uses: actions/upload-artifact@v4
with:
name: docfx-site
path: docs/docfx/_site
chmod +x build-docs.sh
./build-docs.sh

- name: Deploy to GitHub Pages
if: github.ref == 'refs/heads/main'
uses: peaceiris/actions-gh-pages@v3
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/docfx/_site
publish_dir: ./site/.lunet/build/www
publish_branch: gh-pages
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
native-macos-x64:
uses: ./.github/workflows/native-build.yml
with:
runner: macos-13
runner: macos-15-intel
configuration: Release
artifact-name: native-macos-x64

Expand Down
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,11 @@ Testing/

# Generated bridge copy
samples/CrossPlatformSample/NativeMessageBox.CrossPlatformSample.Browser/wwwroot/native-message-box.js

# Documentation output
/site/.lunet/build/
/docs/docfx/_site/
/.tmp-lunet-sample-articles
/.tmp-lunet-sample-lite
/.tmp-lunet-sample
/.tmp-lunet-sample-clear
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,10 @@ int main(void)
- Mobile samples consume the generated AAR/XCFramework to illustrate lifecycle integration. Build the solution via `dotnet build samples/AvaloniaSamples.sln`.

## Documentation
- Run `docs/build-docs.sh` to generate the DocFX site under `docs/docfx/_site`.
- Key entry points: `docs/quickstart.md`, `docs/managed-api.md`, `docs/advanced-usage.md`, `docs/architecture.md`, `docs/android-packaging.md`, `docs/ios-packaging.md`, and `docs/browser-deployment.md`.
- Run `./build-docs.sh` to generate the Lunet site under `site/.lunet/build/www`.
- Run `./serve-docs.sh` for a local watcher + static server loop during doc authoring.
- Published site: `https://wieslawsoltes.github.io/NativeMessageBox/`
- Key entry points: `site/articles/getting-started/quickstart-dotnet.md`, `site/articles/concepts/architecture-and-flow.md`, `site/articles/guides/building-and-packaging.md`, `site/articles/platforms/mobile-platforms.md`, and the generated API output under `site/.lunet/build/www/api/`.

## Contributing
- Review `CONTRIBUTING.md`, `MAINTENANCE.md`, and `SECURITY.md`.
Expand Down
11 changes: 11 additions & 0 deletions build-docs.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
$ErrorActionPreference = 'Stop'

Set-Location $PSScriptRoot
dotnet tool restore
Push-Location (Join-Path $PSScriptRoot 'site')
try {
dotnet tool run lunet --stacktrace build
}
finally {
Pop-Location
}
9 changes: 9 additions & 0 deletions build-docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
set -euo pipefail

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

cd "${SCRIPT_DIR}"
dotnet tool restore
cd "${SCRIPT_DIR}/site"
dotnet tool run lunet --stacktrace build
9 changes: 9 additions & 0 deletions check-docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
set -euo pipefail

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

cd "${SCRIPT_DIR}"
dotnet tool restore
cd "${SCRIPT_DIR}/site"
dotnet tool run lunet --stacktrace build
14 changes: 1 addition & 13 deletions docs/build-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,5 @@
set -euo pipefail

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
DOCFX_DIR="${SCRIPT_DIR}/docfx"

pushd "${SCRIPT_DIR}/.." > /dev/null

dotnet tool restore

export PATH="${HOME}/.dotnet/tools:${PATH}"

dotnet tool run docfx metadata "${DOCFX_DIR}/docfx.json"
dotnet tool run docfx build "${DOCFX_DIR}/docfx.json"

popd > /dev/null

echo "Documentation generated at ${DOCFX_DIR}/_site"
bash "${SCRIPT_DIR}/../build-docs.sh"
52 changes: 52 additions & 0 deletions serve-docs.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
$ErrorActionPreference = 'Stop'

$hostAddress = if ($env:DOCS_HOST) { $env:DOCS_HOST } else { '127.0.0.1' }
$port = if ($env:DOCS_PORT) { $env:DOCS_PORT } else { '8080' }

Set-Location $PSScriptRoot
dotnet tool restore
Push-Location (Join-Path $PSScriptRoot 'site')
try {
if (Get-Command python3 -ErrorAction SilentlyContinue) {
$pythonCommand = 'python3'
$pythonArgs = @('-m', 'http.server', $port, '--bind', $hostAddress)
} elseif (Get-Command python -ErrorAction SilentlyContinue) {
$pythonCommand = 'python'
$pythonArgs = @('-m', 'http.server', $port, '--bind', $hostAddress)
} elseif (Get-Command py -ErrorAction SilentlyContinue) {
$pythonCommand = 'py'
$pythonArgs = @('-3', '-m', 'http.server', $port, '--bind', $hostAddress)
} else {
Write-Warning "Python runtime not found (python3/python/py). Falling back to 'lunet serve'."
dotnet tool run lunet --stacktrace serve
return
}

dotnet tool run lunet --stacktrace build --dev

$watcher = Start-Process -FilePath 'dotnet' `
-ArgumentList @('tool', 'run', 'lunet', '--stacktrace', 'build', '--dev', '--watch') `
-NoNewWindow `
-PassThru

try {
Write-Host "Serving docs at http://${hostAddress}:$port"
Write-Host 'Watching docs with Lunet (dev mode)...'

Push-Location (Join-Path $PSScriptRoot 'site/.lunet/build/www')
try {
& $pythonCommand @pythonArgs
}
finally {
Pop-Location
}
}
finally {
if ($watcher -and -not $watcher.HasExited) {
Stop-Process -Id $watcher.Id -Force
}
}
}
finally {
Pop-Location
}
37 changes: 37 additions & 0 deletions serve-docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/bash
set -euo pipefail

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
HOST="${DOCS_HOST:-127.0.0.1}"
PORT="${DOCS_PORT:-8080}"

cd "${SCRIPT_DIR}"
dotnet tool restore
cd "${SCRIPT_DIR}/site"

if command -v python3 >/dev/null 2>&1; then
PYTHON_BIN="python3"
elif command -v python >/dev/null 2>&1; then
PYTHON_BIN="python"
else
echo "Python runtime not found (python3/python). Falling back to 'lunet serve'." >&2
dotnet tool run lunet --stacktrace serve
exit 0
fi

dotnet tool run lunet --stacktrace build --dev

dotnet tool run lunet --stacktrace build --dev --watch &
LUNET_WATCH_PID=$!

cleanup() {
kill "${LUNET_WATCH_PID}" >/dev/null 2>&1 || true
}

trap cleanup EXIT INT TERM

echo "Serving docs at http://${HOST}:${PORT}"
echo "Watching docs with Lunet (dev mode)..."

cd "${SCRIPT_DIR}/site/.lunet/build/www"
"${PYTHON_BIN}" -m http.server "${PORT}" --bind "${HOST}"
Loading
Loading