Skip to content

Bump version to 0.12.0 #186

Bump version to 0.12.0

Bump version to 0.12.0 #186

Workflow file for this run

name: Deploy to GitHub Pages
on:
push:
branches: [main]
tags: ['v[0-9]+.[0-9]+.[0-9]+*'] # Semver tags only
workflow_dispatch:
permissions:
contents: write
concurrency:
# Single shared queue so main (dev) and tag (release) runs serialize on the
# gh-pages push instead of racing. cancel-in-progress: false means both still
# run — they just take turns.
group: pages-deploy
cancel-in-progress: false
env:
NODE_VERSION: '22'
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Determine deployment target
id: target
run: |
if [[ "${{ github.ref_type }}" == "tag" ]]; then
TAG="${GITHUB_REF_NAME}"
echo "is_release=true" >> $GITHUB_OUTPUT
echo "version=$TAG" >> $GITHUB_OUTPUT
echo "base_path=/$TAG/" >> $GITHUB_OUTPUT
else
echo "is_release=false" >> $GITHUB_OUTPUT
echo "version=dev" >> $GITHUB_OUTPUT
echo "base_path=/dev/" >> $GITHUB_OUTPUT
fi
- uses: actions/setup-node@v6
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'
- run: npm ci
- name: Check
run: npm run check
# Build for version/dev directory
- name: Build
run: npm run build
env:
VITE_BASE: ${{ steps.target.outputs.base_path }}
# Deploy to version directory (v0.3.2 or dev)
- name: Deploy to version directory
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
destination_dir: ${{ steps.target.outputs.version }}
keep_files: true
commit_message: "Deploy ${{ steps.target.outputs.version }}"
# For releases: also update /latest/
- name: Rebuild for latest
if: steps.target.outputs.is_release == 'true'
run: npm run build
env:
VITE_BASE: /latest/
- name: Deploy to latest
if: steps.target.outputs.is_release == 'true'
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
destination_dir: latest
keep_files: true
commit_message: "Update latest to ${{ steps.target.outputs.version }}"
# Update root redirect (only on release)
- name: Create root redirect
if: steps.target.outputs.is_release == 'true'
run: |
mkdir -p root
cat > root/index.html << 'EOF'
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="refresh" content="0; url=/latest/">
<link rel="canonical" href="/latest/">
<title>ColmapView</title>
</head>
<body>
<p>Redirecting to <a href="/latest/">latest version</a>...</p>
</body>
</html>
EOF
touch root/.nojekyll
- name: Deploy root
if: steps.target.outputs.is_release == 'true'
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./root
keep_files: true
commit_message: "Update root redirect"