diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 653be9a28..40a0cfe84 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -54,4 +54,45 @@ jobs: - name: Publish package to Maven Central run: mvn clean deploy -Prelease -Dgpg.passphrase="${GPG_PASSPHRASE}" -DskipTests -B env: - GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} \ No newline at end of file + GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} + + version-docs: + runs-on: ubuntu-latest + needs: publish + steps: + - name: Checkout main + uses: actions/checkout@v4 + with: + ref: main + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: '22' + cache: npm + cache-dependency-path: website/package-lock.json + + - name: Install website dependencies + run: npm ci + working-directory: website + + - name: Extract version from tag + id: version + run: echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT + + - name: Create docs version + run: npx docusaurus docs:version ${{ steps.version.outputs.VERSION }} + working-directory: website + + - name: Update default version in config + run: | + sed -i "s/lastVersion: '.*'/lastVersion: '${{ steps.version.outputs.VERSION }}'/" docusaurus.config.ts + working-directory: website + + - name: Commit and push + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git add . + git commit -m "docs: snapshot version ${{ steps.version.outputs.VERSION }}" + git push \ No newline at end of file diff --git a/website/docusaurus.config.ts b/website/docusaurus.config.ts index fcd7f3b6d..627d140a7 100644 --- a/website/docusaurus.config.ts +++ b/website/docusaurus.config.ts @@ -28,6 +28,13 @@ const config: Config = { path: '../docs', routeBasePath: '/', sidebarPath: './sidebars.ts', + lastVersion: '1.9.0', + versions: { + current: { + label: 'Next', + path: 'next', + }, + }, editUrl: 'https://github.com/storm-repo/storm-framework/edit/main/docs/', }, blog: false, @@ -47,6 +54,10 @@ const config: Config = { srcDark: 'img/storm-light.png', }, items: [ + { + type: 'docsVersionDropdown', + position: 'right', + }, { type: 'docSidebar', sidebarId: 'docs',