Passthrough NamedType
and Flatten
for containers
#96
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This whole workflow exists because Vercel & Cloudflare don't support Rust in their build pipeline and GitHub pages doens't do deploy previews. | |
name: Docs | |
on: | |
push: | |
workflow_dispatch: | |
permissions: | |
contents: read | |
statuses: write | |
env: | |
RUSTDOCFLAGS: --cfg docsrs | |
jobs: | |
deploy-docs: | |
name: "Deploy docs" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Create status check | |
uses: actions/github-script@v6 | |
with: | |
script: | | |
const data = await github.rest.repos.createCommitStatus({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
sha: context.sha, | |
context: "Docs / Vercel deployment", | |
description: "Rust docs (preview)", | |
state: "pending", | |
}); | |
console.log(data); // TODO | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install system dependencies | |
run: sudo apt-get install librust-atk-dev libwebkit2gtk-4.0-dev build-essential libssl-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev | |
- name: Install Node.js | |
uses: actions/setup-node@v3 | |
- name: Install Rust | |
run: curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain nightly && source "$HOME/.cargo/env" | |
- name: Rust cache | |
uses: Swatinem/rust-cache@v2 | |
- name: Build docs | |
run: cargo +nightly doc --all-features --no-deps | |
- name: Add index redirect | |
run: echo "<meta http-equiv=\"refresh\" content=\"0; url=specta\">" > target/doc/index.html | |
- name: Create Vercel deployment | |
id: vercel-deployment | |
run: DEPLOYMENT_URL=$(npx vercel --token ${VERCEL_TOKEN} deploy --archive=tgz ./target/doc) && echo "DEPLOYMENT_URL=$DEPLOYMENT_URL" >> $GITHUB_OUTPUT | |
env: | |
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }} | |
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} | |
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} | |
- name: Update status check | |
uses: actions/github-script@v6 | |
env: | |
DEPLOYMENT_URL: "${{ steps.vercel-deployment.outputs.DEPLOYMENT_URL }}" | |
with: | |
script: | | |
await github.rest.repos.createCommitStatus({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
sha: context.sha, | |
context: "Docs / Vercel deployment", | |
description: "Rust docs (preview)", | |
state: "success", | |
target_url: process.env.DEPLOYMENT_URL, | |
}); |