Skip to content

Commit 3628180

Browse files
authored
docs(turbopack): build, deploy rustdocs (#7342)
### Description This PR sets up daily CI workflow to deploy docs to https://turbopack-rust-docs.vercel.sh/. It currently uses vercel ci to deploy instead of git integration, for couple of reasons - we need to build cross-repo docs (next.js / turbopack) - I didn't want to accidentally disrupt existing deploy connection in this repo / next.js repo This is to get things started; we can / will definitely improve deployment over time. ### Testing Instructions <!-- Give a quick description of steps to test your changes. --> Closes PACK-2375
1 parent 66828a5 commit 3628180

File tree

4 files changed

+103
-28
lines changed

4 files changed

+103
-28
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: Turbopack Nightly Release
2+
3+
on:
4+
schedule:
5+
- cron: "15 8 * * *" # Run every day at 00:15 PST
6+
workflow_dispatch:
7+
inputs:
8+
version:
9+
description: Turbopack (Next.js) version, sha, branch to generate docs
10+
type: string
11+
default: "canary"
12+
prod:
13+
description: Deploy docs to production
14+
type: boolean
15+
default: false
16+
17+
jobs:
18+
# deploy turbopack-specific packages' rustdoc documentation.
19+
turbopack_deploy_rustdocs:
20+
name: Deploy Turbopack rustdocs
21+
runs-on: ubuntu-latest
22+
continue-on-error: true
23+
if: github.repository_owner == 'vercel'
24+
env:
25+
TURBOPACK_RUST_DOCS_VERCEL_CLI_DEPLOY: ${{ secrets.TURBOPACK_RUST_DOCS_VERCEL_CLI_DEPLOY }}
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@v4
29+
30+
- name: Find Next.js latest release version
31+
env:
32+
GH_TOKEN: ${{ github.token }}
33+
run: |
34+
# Grab the latest release version from next.js repo, including prelease. `/releases/latest` will only return latest stable release.
35+
echo NEXJS_LATEST_VERSION=$(gh release --repo vercel/next.js --limit 1 list | sed -n 1p | awk '{print $1}') >> $GITHUB_ENV
36+
37+
- name: Set Next.js release version
38+
run: |
39+
echo "NEXTJS_VERSION=${{ inputs.version != '' && inputs.version || env.NEXJS_LATEST_VERSION }}" >> $GITHUB_ENV
40+
41+
- name: Print Next.js release version to checkout
42+
run: echo "Checking out Next.js ${{ env.NEXTJS_VERSION }}"
43+
44+
- name: Checkout
45+
uses: actions/checkout@v4
46+
with:
47+
repository: vercel/next.js
48+
path: nextjs_upstream
49+
50+
- uses: ./.github/actions/setup-node
51+
52+
- name: Setup Rust
53+
uses: ./.github/actions/setup-rust
54+
with:
55+
github-token: "${{ secrets.GITHUB_TOKEN }}"
56+
57+
- name: Build rustdoc
58+
run: |
59+
# Temporary index page
60+
printf "# Turbopack \n\nWelcome to an overview of the Turbopack documentation.\nCurrently it's work in progress, the only package available is [Turbo tasks-fs](turbo_tasks_fs/index.html)" > index.md
61+
RUSTDOCFLAGS="-Z unstable-options --index-page $(pwd)/index.md" cargo doc --manifest-path ./nextjs_upstream/Cargo.toml --target-dir out_docs -p turbo-tasks-fs --no-deps
62+
63+
- name: Link project
64+
run: |
65+
npx vercel link --cwd ./out_docs/doc --project turbopack-rust-docs --token=$TURBOPACK_RUST_DOCS_VERCEL_CLI_DEPLOY --scope=vercel --yes
66+
67+
- name: Trigger deploy
68+
if: ${{ github.ref != 'refs/heads/main' || !inputs.prod }}
69+
run: |
70+
npx vercel deploy --cwd ./out_docs/doc --token=$TURBOPACK_RUST_DOCS_VERCEL_CLI_DEPLOY --scope=vercel --yes
71+
72+
- name: Trigger deploy (prod)
73+
if: ${{ github.ref == 'refs/heads/main' || inputs.prod }}
74+
run: |
75+
npx vercel deploy --cwd ./out_docs/doc --token=$TURBOPACK_RUST_DOCS_VERCEL_CLI_DEPLOY --scope=vercel --prod --yes

Cargo.lock

+26-26
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ serde_qs = "0.11.0"
256256
serde_with = "2.3.2"
257257
serde_yaml = "0.9.17"
258258
sha2 = "0.10.6"
259-
smallvec = { version = "1.11.1", features = [
259+
smallvec = { version = "1.13.1", features = [
260260
"serde",
261261
"const_generics",
262262
"union",

crates/turbopack-css/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ turbopack-ecmascript = { workspace = true }
3333
turbopack-swc-utils = { workspace = true }
3434

3535
parcel_sourcemap = "2.1.1"
36-
smallvec = "1.11.0"
36+
smallvec = { workspace = true }
3737
swc_core = { workspace = true, features = [
3838
"css_ast",
3939
"css_codegen",

0 commit comments

Comments
 (0)