-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (57 loc) · 1.78 KB
/
release-please.yml
File metadata and controls
66 lines (57 loc) · 1.78 KB
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
name: Release Please
on:
push:
branches: [main]
workflow_dispatch:
inputs:
publish_tag:
description: 'Tag to publish (e.g. v0.1.1). Leave blank to let release-please run normally.'
required: false
default: ''
permissions:
contents: write
pull-requests: write
jobs:
release-please:
name: Release PR / tag
runs-on: ubuntu-latest
if: ${{ github.event_name != 'workflow_dispatch' || inputs.publish_tag == '' }}
outputs:
release_created: ${{ steps.release.outputs.release_created }}
tag_name: ${{ steps.release.outputs.tag_name }}
steps:
- uses: googleapis/release-please-action@v4
id: release
with:
config-file: release-please-config.json
manifest-file: .release-please-manifest.json
publish:
name: Publish to npm
needs: release-please
if: ${{ always() && ((github.event_name == 'workflow_dispatch' && inputs.publish_tag != '') || needs.release-please.outputs.release_created == 'true') }}
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.publish_tag || github.ref }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '24'
registry-url: 'https://registry.npmjs.org'
cache: 'yarn'
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Build
run: yarn prepare
- name: Ensure npm >= 11.5.1 (Trusted Publishing)
run: |
npm --version
npm install -g npm@latest
npm --version
- name: Publish
run: npm publish --access public