-
Notifications
You must be signed in to change notification settings - Fork 1
67 lines (56 loc) · 1.79 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
60
61
62
63
64
65
66
67
on:
push:
branches:
- main
permissions:
contents: write
pull-requests: write
name: release-please
jobs:
release:
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.output-release-created.outputs.release_created }}
steps:
- uses: googleapis/release-please-action@v4
id: release
name: 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.RELEASE_PLEASE_TOKEN }}
# this is a built-in strategy in release-please, see "Action Inputs"
# for more options
release-type: node
- name: Output Release Created
id: output-release-created
run: |
release_created=${{ steps.release.outputs.release_created }}
echo "::set-output name=release_created::$release_created"
publish:
runs-on: ubuntu-latest
needs: release
if: ${{ needs.release.outputs.release_created }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Cache Node Modules
id: cache-node-modules
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-node-
- name: Setup Pnpm
uses: pnpm/action-setup@v3
- name: Install Dependencies
if: ${{ steps.cache-node-modules.outputs.cache-hit != 'true' }}
run: pnpm install
- name: Build Lib
run: pnpm lib:build
- name: Publish
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}