Skip to content

Commit c9fe0bf

Browse files
committed
add release workflow
1 parent d6e9775 commit c9fe0bf

2 files changed

Lines changed: 57 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
release:
8+
types: [published]
9+
workflow_dispatch:
10+
11+
permissions:
12+
contents: read
13+
id-token: write
14+
15+
concurrency:
16+
group: release-${{ github.ref }}
17+
cancel-in-progress: false
18+
19+
jobs:
20+
publish-npm:
21+
if: github.repository == 'browserbase/ModCDP'
22+
runs-on: ubuntu-latest
23+
timeout-minutes: 15
24+
environment: npm
25+
steps:
26+
- uses: actions/checkout@v6
27+
28+
- uses: pnpm/action-setup@v4
29+
30+
- uses: actions/setup-node@v6
31+
with:
32+
node-version: 24
33+
registry-url: https://registry.npmjs.org
34+
package-manager-cache: false
35+
36+
- run: pnpm install --frozen-lockfile
37+
38+
- run: pnpm run build
39+
40+
- name: Prepare alpha version
41+
if: github.event_name == 'push'
42+
run: |
43+
ALPHA_VERSION=$(node -p "(() => {
44+
const version = require('./package.json').version;
45+
const [core] = version.split('-');
46+
return `${core}-alpha.${process.env.GITHUB_RUN_NUMBER}.${process.env.GITHUB_RUN_ATTEMPT}`;
47+
})()")
48+
npm version "$ALPHA_VERSION" --no-git-tag-version
49+
50+
- name: Publish alpha
51+
if: github.event_name == 'push'
52+
run: npm publish --tag alpha
53+
54+
- name: Publish stable
55+
if: github.event_name != 'push'
56+
run: npm publish

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "0.0.19",
44
"repository": {
55
"type": "git",
6-
"url": "git+https://github.com/pirate/modcdp.git"
6+
"url": "git+https://github.com/browserbase/ModCDP.git"
77
},
88
"files": [
99
"js/scripts/**/*.mjs",

0 commit comments

Comments
 (0)