-
-
Notifications
You must be signed in to change notification settings - Fork 18
59 lines (56 loc) · 1.95 KB
/
release-please.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
on:
push:
branches:
- main
permissions:
contents: write
pull-requests: write
name: release-please
jobs:
release-please:
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
- name: Run release-please
uses: google-github-actions/release-please-action@v4
id: release
with:
# this assumes that you have created a personal access token
# (PAT) and configured it as a GitHub action secret named
# `MY_RELEASE_PLEASE_TOKEN` (this secret name is not important).
token: ${{ secrets.GITHUB_TOKEN }}
# this is a built-in strategy in release-please, see "Action Inputs"
# for more options
release-type: node
# The logic below handles the npm publication:
- name: Checkout Git repository
# these if statements ensure that a publication only occurs when
# a new release is created:
if: ${{ steps.release.outputs.release_created }}
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "lts/*"
registry-url: "https://registry.npmjs.org"
cache: yarn
if: ${{ steps.release.outputs.release_created }}
- name: Setup Bun
if: ${{ steps.release.outputs.release_created }}
uses: oven-sh/setup-bun@v2
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "lts/*"
registry-url: "https://registry.npmjs.org"
- name: Install dependencies with Yarn
if: ${{ steps.release.outputs.release_created }}
run: yarn install --immutable
- name: Build and test
run: yarn just build lint docs size validate-api test
if: ${{ steps.release.outputs.release_created }}
- name: Publish
run: npm publish
if: ${{ steps.release.outputs.release_created }}
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}