forked from rolldown/rolldown
-
Notifications
You must be signed in to change notification settings - Fork 0
92 lines (76 loc) · 2.7 KB
/
release-canary.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: A - Release Canary/Nightly
on:
# Manually released. This will publish under the canary npm tag.
workflow_dispatch:
# Every day at midnight. This will publish under the nightly npm tag.
schedule:
- cron: '0 0 * * *'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
plan:
name: Plan release
if: github.repository == 'rolldown/rolldown'
runs-on: ubuntu-latest
outputs:
npm-tag: ${{ github.event_name == 'schedule' && 'nightly' || 'canary' }}
steps:
- run: 'echo "Planning release"'
build:
name: Build bindings and node packages
if: github.repository == 'rolldown/rolldown'
uses: ./.github/workflows/reusable-release-build.yml
publish:
name: Publish npm Packages
if: github.repository == 'rolldown/rolldown'
runs-on: ubuntu-latest
permissions:
contents: write # for softprops/action-gh-release@v1
id-token: write # for `npm publish --provenance`
needs:
- plan
- 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: Canary/Nightly Versioning
run: node ./scripts/misc/bump-version.js snapshot
- name: Publish(Dry Run)
run: |
pnpm publish -r --tag ${{ needs.plan.outputs.npm-tag }} --dry-run --no-git-checks
env:
NPM_TOKEN: ${{ secrets.ROLLDOWN_NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish
run: |
pnpm publish -r --tag ${{ needs.plan.outputs.npm-tag }} --no-git-checks
env:
NPM_TOKEN: ${{ secrets.ROLLDOWN_NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_CONFIG_PROVENANCE: true