Skip to content

Versioned Docs#868

Open
martin0995 wants to merge 12 commits into
wormhole-foundation:mainfrom
martin0995:multi-version-docs
Open

Versioned Docs#868
martin0995 wants to merge 12 commits into
wormhole-foundation:mainfrom
martin0995:multi-version-docs

Conversation

@martin0995

Copy link
Copy Markdown
Contributor

This pull request updates the documentation workflow and associated files to streamline the process of generating and managing versioned documentation for the Wormhole SDK. The changes simplify the GitHub Actions workflow, add new documentation, and introduce version tracking for the documentation.

Documentation Enhancements

  • docs/README.md): Added a new README file explaining the folder structure, update process, and best practices for maintaining the documentation.

Versioned Documentation Script

  • docs/scripts/versioned-docs.ts: The script reads the current SDK version from package.json, and if it detects a new major version, it copies docs/latest/ to docs/vX/, regenerates docs/latest/ using TypeDoc, and updates .version to track the latest documented version.

Version Tracking

  • docs/.version: Introduced a new .version file to track the latest built documentation version, starting with version 2.2.0.

Workflow Improvements

  • .github/workflows/update-docs.yml: Simplified the workflow by replacing the NPM version retrieval with extracting the version from the release tag, consolidating dependency installation steps, and improving the Git commit process to include both package.json and documentation updates.

⚠️ GitHub Pages Configuration Required

For users to access the versioned docs live, we need to update GitHub Pages to serve from the /docs folder in the main branch.

The docs should be accessible at:

run: echo "LATEST_VERSION=$(npm show @wormhole-foundation/sdk version)" >> $GITHUB_ENV
- name: Extract version from release tag (e.g. v3.0.0)
run: |
TAG_VERSION=${GITHUB_REF#refs/tags/v}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should run this action if the tag was a beta tag (e.g. 2.3.0-beta.0) since we probably wouldn't merge the package.json file with the beta version set.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just added this line at the beginning to skip the workflow for beta versions:
if: ${{ !contains(github.ref, '-') }}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kev1n-peters GitHub Action is failing to create the pull request because it doesn't have permission to do so. Someone with admin access needs to update the repository settings to allow it.

@martin0995
martin0995 requested a review from kev1n-peters July 9, 2025 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants