Skip to content

Commit be16d0f

Browse files
add release action
1 parent e910ba4 commit be16d0f

File tree

4 files changed

+81
-5
lines changed

4 files changed

+81
-5
lines changed

.changeset/tired-chefs-invite.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
'plugin-react-router': patch
2+
'rsbuild-plugin-react-router': patch
33
---
44

55
Support React Router

.github/workflows/release.yml

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Release
2+
3+
on:
4+
# Manually trigger the workflow
5+
workflow_dispatch:
6+
inputs:
7+
branch:
8+
description: 'Branch to run release from'
9+
required: true
10+
default: 'main'
11+
type: string
12+
13+
concurrency: ${{ github.workflow }}-${{ github.ref }}
14+
15+
jobs:
16+
release:
17+
name: Release
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout Repo
21+
uses: actions/checkout@v4
22+
with:
23+
# Checkout the branch specified in the trigger, or the head ref of the PR
24+
ref: ${{ github.event.inputs.branch || github.ref }}
25+
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
26+
fetch-depth: 0
27+
28+
- name: Setup Node.js
29+
uses: actions/setup-node@v4
30+
with:
31+
node-version: 22
32+
cache: 'pnpm'
33+
registry-url: 'https://registry.npmjs.org/'
34+
35+
- name: Setup PNPM
36+
uses: pnpm/action-setup@v3
37+
with:
38+
version: 9
39+
40+
- name: Install Dependencies
41+
run: pnpm install --frozen-lockfile
42+
43+
- name: Build Project
44+
run: pnpm build
45+
46+
- name: Create Release Pull Request or Publish to npm
47+
id: changesets
48+
uses: changesets/action@v1
49+
with:
50+
# Run our custom release script that builds and publishes
51+
publish: pnpm release
52+
env:
53+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
54+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
55+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
56+
57+
- name: Display Release Information
58+
if: steps.changesets.outputs.published == 'true'
59+
run: |
60+
echo "🎉 Published packages to npm!"
61+
echo "Published packages: ${{ steps.changesets.outputs.publishedPackages }}"

examples/custom-node-server/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
2-
"name": "rsbuild-react-router",
2+
"name": "custom-node-example",
3+
"private": true,
34
"version": "1.0.0",
45
"description": "",
56
"type": "module",

package.json

+17-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,27 @@
11
{
2-
"name": "plugin-react-router",
2+
"name": "rsbuild-plugin-react-router",
33
"version": "0.0.0",
44
"description": "React Router plugin for Rsbuild",
55
"repository": {
66
"type": "git",
77
"url": "git+https://github.com/rspack-contrib/rsbuild-plugin-react-router.git",
88
"directory": ""
99
},
10+
"keywords": [
11+
"rsbuild",
12+
"rsbuild-plugin",
13+
"react-router",
14+
"react",
15+
"router",
16+
"ssr",
17+
"rspack",
18+
"plugin",
19+
"remix",
20+
"module-federation"
21+
],
1022
"license": "MIT",
1123
"type": "module",
24+
"registry": "https://registry.npmjs.org/",
1225
"exports": {
1326
".": {
1427
"types": "./dist/index.d.ts",
@@ -47,7 +60,8 @@
4760
"format:check": "prettier --check \"src/**/*.{js,jsx,ts,tsx}\"",
4861
"changeset": "changeset",
4962
"version": "changeset version",
50-
"release": "pnpm build && changeset version && changeset publish"
63+
"release": "changeset publish",
64+
"release:local": "pnpm build && changeset version && changeset publish"
5165
},
5266
"dependencies": {
5367
"@babel/core": "^7.26.3",
@@ -102,7 +116,7 @@
102116
},
103117
"publishConfig": {
104118
"access": "public",
105-
"provenance": true,
119+
"provenance": false,
106120
"registry": "https://registry.npmjs.org/"
107121
},
108122
"packageManager": "pnpm@9.15.3+sha512.1f79bc245a66eb0b07c5d4d83131240774642caaa86ef7d0434ab47c0d16f66b04e21e0c086eb61e62c77efc4d7f7ec071afad3796af64892fae66509173893a",

0 commit comments

Comments
 (0)