Skip to content

Release

Release #4

Workflow file for this run

name: Release
# Runs after CI succeeds on a main-branch push. Releases only when that commit has a
# vX.Y.Z tag (created by `docks release`).
on:
workflow_run:
workflows: [CI]
types: [completed]
permissions:
actions: read
contents: write
id-token: write
jobs:
resolve:
if: >
github.event.workflow_run.conclusion == 'success' &&
github.event.workflow_run.event == 'push' &&
github.event.workflow_run.head_branch == 'main'
runs-on: ubuntu-latest
outputs:
version: ${{ steps.tag.outputs.version }}
steps:
- name: Checkout tested commit
uses: actions/checkout@v7
with:
ref: ${{ github.event.workflow_run.head_sha }}
fetch-depth: 0
- name: Find release tag on commit
id: tag
run: |
TAG=$(git tag --points-at HEAD | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | head -1 || true)
if [ -z "$TAG" ]; then
echo "No release tag on ${{ github.event.workflow_run.head_sha }}; skipping release."
else
echo "Release tag: $TAG"
fi
echo "version=$TAG" >> $GITHUB_OUTPUT
release:
needs: resolve
if: needs.resolve.outputs.version != ''
permissions:
contents: write
uses: ./.github/workflows/app-release.yml
with:
version: ${{ needs.resolve.outputs.version }}
publish_dir: packages/app/dist
build_command: npm run build:app
node_version_file: .nvmrc
cname: docks.eclipse.dev
secrets: inherit
deploy-docs:
needs: release
if: needs.release.outputs.version != ''
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v7
with:
ref: ${{ needs.release.outputs.version }}
- name: Set up Node.js
uses: actions/setup-node@v7
with:
node-version-file: '.nvmrc'
cache: npm
- name: Install dependencies
run: npm ci
- name: Build docs
env:
DOCKS_DOCS_VERSION: ${{ needs.release.outputs.version }}
run: npm run docs:build
- name: Deploy docs to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/.vitepress/dist
destination_dir: docs
publish_branch: gh-pages
keep_files: true
publish-npm:
needs: release
if: needs.release.outputs.version != ''
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@v7
with:
ref: ${{ needs.release.outputs.version }}
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v7
with:
node-version-file: '.nvmrc'
registry-url: "https://registry.npmjs.org"
cache: npm
- name: Install dependencies
run: npm ci
- name: Update package versions (CI only, not committed)
run: |
VERSION="${{ needs.release.outputs.version }}"
VERSION="${VERSION#v}"
for pkg in packages/core packages/extension-* packages/create-app packages/cli; do
[ -d "$pkg" ] && (cd "$pkg" && npm version "$VERSION" --no-git-tag-version) && echo "Updated $pkg to $VERSION"
done
- name: Build core package
run: npm run build
- name: Build extension packages
run: npm run build:extensions
- name: Run type check
run: npm run type-check
continue-on-error: true
- name: Publish core, extensions, create-app, and cli to npm
run: |
for pkg in packages/core packages/extension-* packages/create-app packages/cli; do
if [ -d "$pkg" ]; then
if grep -q '"private":\s*true' "$pkg/package.json" 2>/dev/null; then
echo "Skipping $pkg (private)"
else
echo "Publishing $pkg..."
(cd "$pkg" && npm publish --access public --provenance)
fi
fi
done