Skip to content

Commit be79f87

Browse files
committed
ci: add logic for releases
1 parent 318d964 commit be79f87

4 files changed

Lines changed: 78 additions & 25 deletions

File tree

.github/workflows/build.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- uses: actions/setup-node@v4
17+
with:
18+
node-version: lts/*
19+
cache: npm
20+
21+
- name: Install dependencies
22+
run: npm install
23+
24+
- name: Build
25+
run: npm run build
26+
27+
release-please:
28+
runs-on: ubuntu-latest
29+
needs: build
30+
if: github.event_name == 'push'
31+
permissions:
32+
contents: write
33+
pull-requests: write
34+
outputs:
35+
release_created: ${{ steps.release.outputs.release_created }}
36+
steps:
37+
- uses: googleapis/release-please-action@v4
38+
id: release
39+
with:
40+
token: ${{ secrets.GITHUB_TOKEN }}
41+
42+
publish:
43+
runs-on: ubuntu-latest
44+
needs: release-please
45+
if: needs.release-please.outputs.release_created == 'true'
46+
permissions:
47+
contents: read
48+
id-token: write
49+
steps:
50+
- uses: actions/checkout@v4
51+
52+
- uses: actions/setup-node@v4
53+
with:
54+
node-version: lts/*
55+
registry-url: https://registry.npmjs.org
56+
cache: npm
57+
58+
- name: Install dependencies
59+
run: npm install
60+
61+
- name: Build
62+
run: npm run build
63+
64+
- name: Publish to npm
65+
run: npm publish --provenance --access public
66+
env:
67+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.release-please-manifest.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "0.1.0"
3+
}

release-please-config.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"packages": {
3+
".": {
4+
"release-type": "node",
5+
"package-name": "@typespecs/blocknote",
6+
}
7+
}
8+
}

0 commit comments

Comments
 (0)