Skip to content

Commit 2e2a964

Browse files
committed
add release.yml
1 parent 36ca4f7 commit 2e2a964

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

.github/workflows/release.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions: {}
9+
jobs:
10+
release:
11+
# prevents this action from running on forks
12+
if: github.repository == 'sveltejs/esrap'
13+
permissions:
14+
contents: write # to create release (changesets/action)
15+
id-token: write # OpenID Connect token needed for provenance
16+
pull-requests: write # to create pull request (changesets/action)
17+
name: Release
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout Repo
21+
uses: actions/checkout@v4
22+
with:
23+
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
24+
fetch-depth: 0
25+
- uses: pnpm/action-setup@v4
26+
- name: Setup Node.js
27+
uses: actions/setup-node@v4
28+
with:
29+
node-version: 18.x
30+
cache: pnpm
31+
32+
- name: Install
33+
run: pnpm install --frozen-lockfile
34+
35+
- name: Build
36+
run: pnpm build
37+
38+
- name: Create Release Pull Request or Publish to npm
39+
id: changesets
40+
uses: changesets/action@v1
41+
env:
42+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43+
NPM_CONFIG_PROVENANCE: true
44+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)