Skip to content

Commit d4e04f3

Browse files
authored
Add changesets and release workflow (#141)
1 parent 45a77be commit d4e04f3

File tree

5 files changed

+1378
-15
lines changed

5 files changed

+1378
-15
lines changed

.changeset/config.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/config@2.1.1/schema.json",
3+
"commit": false,
4+
"fixed": [],
5+
"linked": [],
6+
"baseBranch": "main",
7+
"updateInternalDependencies": "patch",
8+
"changelog": [
9+
"@changesets/changelog-github",
10+
{
11+
"repo": "browserbase/stagehand"
12+
}
13+
],
14+
"snapshot": {
15+
"useCalculatedVersion": true,
16+
"prereleaseTemplate": "{tag}-{datetime}-{commit}"
17+
}
18+
}

.github/workflows/pr.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: "pr"
2+
on:
3+
pull_request:
4+
branches:
5+
- "main"
6+
paths:
7+
- ".changeset/**/*.md"
8+
9+
jobs:
10+
release:
11+
runs-on: "ubuntu-22.04"
12+
if: github.event.pull_request.head.repo.full_name == github.repository # run only for original, non-fork PRs
13+
steps:
14+
- uses: "actions/checkout@v3"
15+
with:
16+
fetch-depth: 0
17+
ref: ${{ github.event.pull_request.head.sha }}
18+
- uses: "actions/setup-node@v3"
19+
with:
20+
node-version: 18
21+
cache: "npm"
22+
- name: "Cancel previous runs"
23+
uses: "styfle/cancel-workflow-action@0.11.0"
24+
continue-on-error: true
25+
with:
26+
access_token: ${{ secrets.GITHUB_TOKEN }}
27+
- run: "npm i"
28+
- uses: "the-guild-org/changesets-snapshot-action@v0.0.1"
29+
with:
30+
tag: "alpha"
31+
prepareScript: "npm build"
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/release.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: "release"
2+
on:
3+
push:
4+
branches:
5+
- "main"
6+
7+
jobs:
8+
publish:
9+
runs-on: "ubuntu-22.04"
10+
steps:
11+
- uses: "actions/checkout@v3"
12+
with:
13+
fetch-depth: 0
14+
- uses: "actions/setup-node@v3"
15+
with:
16+
node-version: 18
17+
cache: "npm"
18+
- name: "Cancel previous runs"
19+
uses: "styfle/cancel-workflow-action@0.11.0"
20+
continue-on-error: true
21+
with:
22+
access_token: ${{ secrets.GITHUB_TOKEN }}
23+
- run: "npm i"
24+
- run: "npm run build"
25+
env:
26+
- name: "release / pull_request"
27+
id: "changesets"
28+
uses: "dotansimha/changesets-action@v1.5.2"
29+
with:
30+
publish: "npm run release"
31+
version: "npm exec changeset version"
32+
commit: "Update stagehand version"
33+
title: "Upcoming Release Changes"
34+
createGithubReleases: "aggregate"
35+
env:
36+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
37+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)