Skip to content

Commit 091b61c

Browse files
authored
chore: setup nightly releases (#467)
1 parent fd687b3 commit 091b61c

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

.github/workflows/ci.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ on:
88
branches:
99
- main
1010

11+
permissions:
12+
id-token: write
13+
1114
jobs:
1215
ci:
1316
runs-on: ubuntu-latest
@@ -16,6 +19,8 @@ jobs:
1619
node: [16, 18, 20]
1720
steps:
1821
- uses: actions/checkout@v3
22+
with:
23+
fetch-depth: 0
1924
- run: corepack enable
2025
- uses: actions/setup-node@v3
2126
with:
@@ -27,3 +32,15 @@ jobs:
2732
- run: pnpm test:types
2833
- run: pnpm vitest --coverage && rm -rf coverage/tmp
2934
- uses: codecov/codecov-action@v3
35+
- name: nightly release
36+
if: |
37+
github.event_name == 'push' &&
38+
matrix.node == 20 &&
39+
!contains(github.event.head_commit.message, '[skip-release]') &&
40+
!contains(github.event.head_commit.message, 'docs')
41+
run: |
42+
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> ~/.npmrc &&
43+
pnpm changelogen --canary nightly --publish
44+
env:
45+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
46+
NPM_CONFIG_PROVENANCE: true

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,26 @@ yarn add h3
3838
pnpm add h3
3939
```
4040

41+
<details>
42+
<summary>Using Nightly Releases</summary>
43+
44+
You can try latest changes of h3 landing to the `main` branch by using [`h3-nightly`](https://www.npmjs.com/package/h3-nightly) package.
45+
46+
You can directly swap from `h3` to `h3-nightly` for both dependency and imports, or use `resolutions` feature in `package.json` (recommanded):
47+
48+
```json
49+
{
50+
"dependencies": {
51+
"h3": "latest"
52+
},
53+
"resolutions": {
54+
"h3": "npm:h3-nightly@latest"
55+
}
56+
}
57+
```
58+
59+
</details>
60+
4161
## Usage
4262

4363
```ts

0 commit comments

Comments
 (0)