Skip to content

Commit 71fedbe

Browse files
authored
chore: support Trusted publishing for npm packages (#3318)
* chore: support Trusted publishing for npm packages * chore: 更新 lock 文件 * docs: 降低 Vue 组件的顺序
1 parent f02c68a commit 71fedbe

File tree

5 files changed

+1081
-645
lines changed

5 files changed

+1081
-645
lines changed

.github/workflows/auto-release.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,19 @@ on:
77
- alpha
88
- next
99

10+
permissions:
11+
contents: write
12+
id-token: write
13+
issues: write
14+
pull-requests: write
15+
1016
jobs:
1117
release:
1218
runs-on: ubuntu-latest
1319
if: "!contains(github.event.head_commit.message, '[skip ci]') && startsWith(github.event.head_commit.message , 'chore(release):')"
1420
strategy:
1521
matrix:
16-
node-version: [20] # semantic-release 需要 >= 16 的 Node.js 环境
22+
node-version: [24] # npm trust publish 需要 Nodejs 24
1723

1824
steps:
1925
- uses: actions/checkout@v4
@@ -26,7 +32,7 @@ jobs:
2632

2733
- uses: pnpm/action-setup@v4
2834
with:
29-
version: 9
35+
version: 10
3036

3137
- name: Use Node.js ${{ matrix.node-version }}
3238
uses: actions/setup-node@v4
@@ -62,7 +68,6 @@ jobs:
6268
- name: Release
6369
env:
6470
GITHUB_TOKEN: ${{ secrets.HUIYU_GITHUB_TOKEN }}
65-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
6671
npm_config_legacy_peer_deps: true
6772
run: pnpm release
6873

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
"build:umd": "pnpm -r --filter \"{packages/**}\" --stream build:umd",
6060
"build:size-limit": "pnpm -r --filter \"{packages/**}\" --stream build:size-limit",
6161
"build:size-limit-json": "pnpm -r --filter \"{packages/**}\" --stream build:size-limit-json",
62-
"release": "pnpm -r --filter !@antv/s2-site --filter !@antv/s2-ssr --workspace-concurrency=1 exec npx --no-install semantic-release",
62+
"release": "pnpm -r --filter !@antv/s2-site --filter !@antv/s2-ssr --filter !@antv/s2-monorepo --workspace-concurrency=1 exec npx --no-install semantic-release",
6363
"release:preview": "pnpm release --dry-run --no-ci",
6464
"release:bump-version": "node ./scripts/bump-version.js",
6565
"test": "pnpm -r --filter \"{packages/**}\" --stream test",
@@ -181,8 +181,8 @@
181181
"rollup-plugin-postcss": "^4.0.2",
182182
"rollup-plugin-typescript2": "^0.36.0",
183183
"rollup-plugin-visualizer": "^5.12.0",
184-
"semantic-release": "^19.0.5",
185-
"semantic-release-monorepo": "^7.0.8",
184+
"semantic-release": "^25.0.2",
185+
"semantic-release-monorepo": "^8.0.2",
186186
"size-limit": "^11.1.4",
187187
"stylelint": "^15.11.0",
188188
"stylelint-config-prettier": "^9.0.5",

packages/s2-vue/README.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,6 @@ const rawOptions: S2Options = {
313313
import type { S2DataConfig, S2Options } from '@antv/s2';
314314
import { SheetComponent } from '@antv/s2-vue';
315315
import { defineComponent, onMounted, reactive, shallowRef } from 'vue';
316-
import "@antv/s2-vue/dist/s2-vue.min.css";
317316

318317
export default defineComponent({
319318
setup() {
@@ -343,16 +342,24 @@ export default defineComponent({
343342
</template>
344343
```
345344

346-
### 3. 渲染
345+
### 3. 挂载节点
346+
347+
```html
348+
<!-- index.html -->
349+
<div id="app"></div>
350+
```
351+
352+
### 4. 渲染
347353

348354
```ts
355+
// index.ts
349356
import { createApp } from 'vue';
350357
import App from './App.vue';
358+
import "@antv/s2-vue/dist/s2-vue.min.css";
351359

352360
createApp(App).mount('#app');
353-
354361
```
355362

356-
### 4. 结果
363+
### 5. 结果
357364

358365
![result](https://gw.alipayobjects.com/zos/antfincdn/rf1gPzsFQ/2e3f09f1-6f94-4981-91d4-8c7a770574be.png)

0 commit comments

Comments
 (0)