Skip to content

Commit 57d4d6a

Browse files
authored
Create release.yaml
1 parent b76ec5b commit 57d4d6a

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed

.github/workflows/release.yaml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Release
2+
3+
on:
4+
workflow_dispatch: # Only run when manually triggered
5+
6+
jobs:
7+
release:
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- name: Checkout repository
12+
uses: actions/checkout@v4
13+
14+
- name: Set up Node.js
15+
uses: actions/setup-node@v5
16+
with:
17+
node-version: 20
18+
package-manager-cache: false # disable built-in caching
19+
20+
- name: Enable Corepack
21+
run: corepack enable
22+
23+
- name: Cache Yarn dependencies
24+
uses: actions/cache@v4
25+
with:
26+
path: |
27+
.yarn/cache
28+
**/.yarn/berry/cache
29+
key: yarn-${{ hashFiles('**/yarn.lock') }}
30+
restore-keys: |
31+
yarn-
32+
33+
- name: Install dependencies
34+
run: yarn install --immutable
35+
36+
- name: Run build & tests
37+
run: |
38+
cd tests
39+
yarn clean
40+
cd ..
41+
yarn clean
42+
yarn clean:all
43+
yarn build
44+
yarn test
45+
yarn update-samples
46+
yarn test:samples
47+
48+
- name: Run release-it
49+
env:
50+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
51+
run: yarn release
52+
53+
- name: Configure npm authentication
54+
run: |
55+
yarn config set npmRegistryServer "https://registry.npmjs.org"
56+
yarn config set npmAuthToken ${{ secrets.NPM_TOKEN }}
57+
58+
- name: Publish workspaces to npm
59+
run: yarn workspaces foreach --all --no-private -v -p npm publish --tolerate-republish
60+
```

0 commit comments

Comments
 (0)