From c91421c7e1f595d7c78b8234439ac266149f65c6 Mon Sep 17 00:00:00 2001 From: Josh Vlk Date: Mon, 31 Aug 2026 09:34:14 -0400 Subject: [PATCH] ci: restore alpha releases and docs deployment --- .github/workflows/ci.yml | 37 +++++++++++++++++++++++++++---------- README.md | 4 ++-- docs/content/docs/index.mdx | 6 +++--- docs/llm.js | 4 ++-- 4 files changed, 34 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d5d266eb..6ec3bfce 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,8 +10,6 @@ on: permissions: contents: read - pages: write - id-token: write jobs: build: @@ -24,8 +22,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v7 with: - node-version: "22" - registry-url: https://registry.npmjs.org # Needed to make auth work for publishing + node-version: "24" - name: Install dependencies run: npm ci @@ -61,7 +58,7 @@ jobs: - name: Update package version to - env: - PACKAGE_VERSION: ${{ steps.package-version.outputs.current-version }}-experimental-${{ env.COMMIT_HASH }} + PACKAGE_VERSION: ${{ steps.package-version.outputs.current-version }}-alpha-${{ env.COMMIT_HASH }} run: | node <<'NODE' const fs = require("node:fs"); @@ -77,18 +74,38 @@ jobs: - name: Upload npm package artifact uses: actions/upload-artifact@v7 with: - name: npm-packages + name: npm-package path: "*.tgz" + release: + needs: build + if: github.ref == 'refs/heads/main' && github.event_name == 'push' + runs-on: ubuntu-latest + permissions: + contents: read + id-token: write + steps: + - name: Setup Node.js + uses: actions/setup-node@v7 + with: + node-version: "24" + registry-url: https://registry.npmjs.org + package-manager-cache: false + + - name: Download npm package artifact + uses: actions/download-artifact@v8 + with: + name: npm-package + - name: Publish npm package - if: github.ref == 'refs/heads/main' && github.event_name == 'push' - env: - NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }} - run: npm publish --access public --tag experimental + run: npm publish ./rescript-webapi-*.tgz --access public --tag alpha deploy-docs: needs: build runs-on: ubuntu-latest + permissions: + pages: write + id-token: write environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} diff --git a/README.md b/README.md index 18f37ad5..d19fa525 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![NPM Version](https://img.shields.io/npm/v/@rescript/webapi/experimental)](https://www.npmjs.com/package/@rescript/webapi) +[![NPM Version](https://img.shields.io/npm/v/@rescript/webapi/alpha)](https://www.npmjs.com/package/@rescript/webapi) # experimental-rescript-webapi @@ -9,7 +9,7 @@ Experimental successor to [rescript-webapi](https://github.com/TheSpyder/rescrip Install the package using your favorite package manager: ```shell -npm i @rescript/webapi@experimental +npm i @rescript/webapi@alpha ``` and add `@rescript/webapi` to your `rescript.json`: diff --git a/docs/content/docs/index.mdx b/docs/content/docs/index.mdx index 19242735..d02839a2 100644 --- a/docs/content/docs/index.mdx +++ b/docs/content/docs/index.mdx @@ -19,7 +19,7 @@ tableOfContents: false import { Tabs, TabItem, Code } from "@astrojs/starlight/components"; -[![NPM Version](https://img.shields.io/npm/v/@rescript/webapi/experimental)](https://www.npmjs.com/package/@rescript/webapi) +[![NPM Version](https://img.shields.io/npm/v/@rescript/webapi/alpha)](https://www.npmjs.com/package/@rescript/webapi) ## Installation @@ -27,10 +27,10 @@ Install the package using your favorite package manager: - + - + diff --git a/docs/llm.js b/docs/llm.js index 045342da..4e957660 100644 --- a/docs/llm.js +++ b/docs/llm.js @@ -144,9 +144,9 @@ files.sort(); const pages = await Promise.all(files.map(processFile)); const packageJson = await fs.readFile(path.join(import.meta.dirname, "../package.json"), "utf-8"); -let version = JSON.parse(packageJson).version; +const version = JSON.parse(packageJson).version; const sha = await execAsync("git rev-parse --short HEAD").then(({ stdout }) => stdout.trim()); -const fullVersion = `${version}-experimental-${sha}`; +const fullVersion = `${version}-alpha-${sha}`; const header = `Experimental ReScript WebAPI Documentation ${fullVersion} This is the API documentation for the experimental WebAPI module version ${fullVersion}.