From 16d126f9e40adf7419eda9cbb5fc35dd9801b3ca Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 7 Apr 2026 14:47:19 +0000 Subject: [PATCH 1/3] Initial plan From 195a4e55dda7942b99c219bf30a5f0c9343e63a4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 7 Apr 2026 14:56:55 +0000 Subject: [PATCH 2/3] Fix docs hero image layout and automate version from latest GitHub release Agent-Logs-Url: https://github.com/dexcompiler/Clockworks/sessions/21296d3a-2fd7-453f-a841-c46ee0a45a88 Co-authored-by: dexcompiler <115876036+dexcompiler@users.noreply.github.com> --- .github/workflows/docs.yml | 29 ++++++++++++++++++++++++++++- docs/.vitepress/config.ts | 4 +++- docs/index.md | 3 --- 3 files changed, 31 insertions(+), 5 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index b2e9764..ee2f8af 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -5,6 +5,8 @@ on: branches: [main] pull_request: branches: [main] + release: + types: [published] workflow_dispatch: permissions: @@ -37,11 +39,36 @@ jobs: working-directory: docs run: npm ci + - name: Resolve latest release version + id: resolve_version + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + # For deployment builds (main push or release), resolve the real version and fail if unresolvable. + # For pull requests and workflow_dispatch, fall back to "dev" so preview builds still succeed. + if [[ "${{ github.event_name }}" == "push" || "${{ github.event_name }}" == "release" ]]; then + VERSION=$(gh release view --repo "${{ github.repository }}" --json tagName -q '.tagName' 2>/dev/null || true) + if [[ -z "$VERSION" ]]; then + echo "ERROR: Could not resolve latest release version from GitHub." >&2 + exit 1 + fi + if ! [[ "$VERSION" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + echo "ERROR: Resolved version '$VERSION' does not match expected semver format (vX.Y.Z)." >&2 + exit 1 + fi + else + VERSION="dev" + fi + echo "Resolved docs version: $VERSION" + echo "version=$VERSION" >> "$GITHUB_OUTPUT" + - name: Prepare logo asset run: cp assets/clockworks-display-resized.png docs/public/logo.png - name: Build VitePress site working-directory: docs + env: + DOCS_VERSION: ${{ steps.resolve_version.outputs.version }} run: npm run docs:build - name: Upload Pages artifact @@ -51,7 +78,7 @@ jobs: deploy: needs: build - if: github.ref == 'refs/heads/main' + if: github.ref == 'refs/heads/main' || github.event_name == 'release' runs-on: ubuntu-latest environment: name: github-pages diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index 98fc745..18e3ffa 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -1,5 +1,7 @@ import { defineConfig } from 'vitepress' +const docsVersion = process.env.DOCS_VERSION ?? 'dev' + export default defineConfig({ base: '/Clockworks/', title: 'Clockworks', @@ -33,7 +35,7 @@ export default defineConfig({ }, { text: 'Changelog', link: '/changelog' }, { - text: 'v1.3.0', + text: docsVersion, link: 'https://github.com/dexcompiler/Clockworks/releases', target: '_blank', }, diff --git a/docs/index.md b/docs/index.md index 69baeb4..d2221c8 100644 --- a/docs/index.md +++ b/docs/index.md @@ -5,9 +5,6 @@ hero: name: Clockworks text: 'Time is just another dependency.' tagline: 'Deterministic, fully controllable time and time-ordered identifiers for distributed-system simulations and testing. Built on .NET 10 TimeProvider.' - image: - src: /logo.png - alt: Clockworks actions: - theme: brand text: Get Started From 7fe70eebf84fb0034b656c4ab7acdc0d53a1c3a7 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Wed, 8 Apr 2026 02:37:39 +0000 Subject: [PATCH 3/3] Use release tag_name for docs version on release deploy Co-authored-by: Dexter Ajoku --- .github/workflows/docs.yml | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index ee2f8af..4b4c327 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -44,20 +44,27 @@ jobs: env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - # For deployment builds (main push or release), resolve the real version and fail if unresolvable. + # For deployment builds: + # - On release events, use the event's tag name (source of truth for that deployment). + # - On main pushes, resolve the latest release tag from GitHub. # For pull requests and workflow_dispatch, fall back to "dev" so preview builds still succeed. - if [[ "${{ github.event_name }}" == "push" || "${{ github.event_name }}" == "release" ]]; then + if [[ "${{ github.event_name }}" == "release" ]]; then + VERSION="${{ github.event.release.tag_name }}" + elif [[ "${{ github.event_name }}" == "push" ]]; then VERSION=$(gh release view --repo "${{ github.repository }}" --json tagName -q '.tagName' 2>/dev/null || true) + else + VERSION="dev" + fi + + if [[ "${{ github.event_name }}" == "push" || "${{ github.event_name }}" == "release" ]]; then if [[ -z "$VERSION" ]]; then - echo "ERROR: Could not resolve latest release version from GitHub." >&2 + echo "ERROR: Could not resolve docs version." >&2 exit 1 fi if ! [[ "$VERSION" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then echo "ERROR: Resolved version '$VERSION' does not match expected semver format (vX.Y.Z)." >&2 exit 1 fi - else - VERSION="dev" fi echo "Resolved docs version: $VERSION" echo "version=$VERSION" >> "$GITHUB_OUTPUT"