chore(rsc): release for react canary/experimental channel [not merge] #1986
Workflow file for this run
This file contains hidden or 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
name: Preview Publish | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
types: [opened, synchronize, labeled] | |
permissions: {} | |
jobs: | |
preview: | |
if: > | |
github.repository == 'vitejs/vite-plugin-react' && | |
(github.event_name == 'push' || | |
(github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'trigger: preview'))) | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v5 | |
- name: Install pnpm | |
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0 | |
- uses: actions/setup-node@v5 | |
with: | |
node-version: lts/* | |
# disable cache, to avoid cache poisoning (https://docs.zizmor.sh/audits/#cache-poisoning) | |
package-manager-cache: false | |
- name: Disallow installation scripts | |
run: yq '.onlyBuiltDependencies = []' -i pnpm-workspace.yaml | |
- name: Install dependencies | |
run: pnpm install | |
- name: Build | |
run: pnpm build | |
- name: Publish | |
run: pnpm dlx [email protected] publish --pnpm --compact './packages/*' './packages/plugin-react-swc/dist' | |
nightly: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
- uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0 | |
- run: pnpm i | |
- run: pnpm build | |
# canary | |
- run: | | |
pnpm -C packages/plugin-rsc i react-server-dom-webpack@canary | |
pnpm i --no-frozen-lockfile | |
pnpm -C packages/plugin-rsc build | |
cp -rf packages/plugin-rsc packages/plugin-rsc-canary | |
sed -i 's#"name": "@vitejs/plugin-rsc"#"name": "@vitejs/plugin-rsc-canary"#' packages/plugin-rsc-canary/package.json | |
# experimental | |
- run: | | |
pnpm -C packages/plugin-rsc i react-server-dom-webpack@experimental | |
pnpm i --no-frozen-lockfile | |
pnpm -C packages/plugin-rsc build | |
cp -rf packages/plugin-rsc packages/plugin-rsc-experimental | |
sed -i 's#"name": "@vitejs/plugin-rsc"#"name": "@vitejs/plugin-rsc-experimental"#' packages/plugin-rsc-experimental/package.json | |
# strip prepack to avoid duplicate builds | |
- run: | | |
sed -i 's#"prepack"#"x-prepack"#' packages/plugin-rsc-canary/package.json | |
sed -i 's#"prepack"#"x-prepack"#' packages/plugin-rsc-experimental/package.json | |
- run: | | |
pnpx pkg-pr-new publish --comment=off \ | |
packages/plugin-rsc-canary \ | |
packages/plugin-rsc-experimental \ |