forked from rolldown/rolldown
-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (62 loc) · 2.12 KB
/
publish-packages.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Publish Packages
on:
push:
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build bindings and node packages
uses: ./.github/workflows/reusable-release-build.yml
publish:
if: github.repository == 'rolldown/rolldown'
name: Publish npm Packages
runs-on: ubuntu-latest
permissions:
contents: write # for softprops/action-gh-release@v1
id-token: write # for `npm publish --provenance`
needs:
- build
steps:
- uses: actions/checkout@v4
- name: Setup Node
uses: ./.github/actions/setup-node
- name: Git Reset Hard
run: git reset --hard # fix pnpm install add new line for package.json
- name: Download Binding Artifacts
uses: actions/download-artifact@v4
with:
path: packages/rolldown/artifacts
- name: Move Binding Artifacts
run: pnpm --filter rolldown artifacts
- name: List Rolldown Bindings
run: ls -R ./packages/rolldown/npm
shell: bash
- name: Download Node Artifacts
uses: actions/download-artifact@v4
with:
path: packages/rolldown/dist
name: node-artifact
- name: Copy Licenses
run: |
find ./packages/ -type d -maxdepth 1 -exec cp LICENSE {} \;
find ./packages/ -type d -maxdepth 1 -exec cp THIRD-PARTY-LICENSE {} \;
- name: Set Publishing Config
run: pnpm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
env:
NPM_TOKEN: ${{ secrets.ROLLDOWN_NPM_TOKEN }}
- name: Publish(Dry Run)
run: |
pnpm publish -r --tag latest --dry-run --no-git-checks
env:
NPM_TOKEN: ${{ secrets.ROLLDOWN_NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish
run: |
pnpm publish -r --tag latest --no-git-checks
env:
NPM_TOKEN: ${{ secrets.ROLLDOWN_NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_CONFIG_PROVENANCE: true