Repository navigation
68 lines (62 loc) · 2.39 KB
/
Copy pathrelease-please.yml
File metadata and controls
68 lines (62 loc) · 2.39 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
67
68
name: Release Please
on:
push:
branches:
- main
workflow_dispatch:
inputs:
publish_only:
description: "Skip release-please, just publish the current version to npm"
type: boolean
default: true
permissions:
contents: write
pull-requests: write
id-token: write
jobs:
release-please:
if: ${{ !inputs.publish_only }}
runs-on: ubuntu-latest
outputs:
# releases_created is the top-level boolean release-please-action v4
# sets when any release happens. (Component-prefixed keys like
# "meridian-plugin-pi-scrub--release_created" are NOT actually the
# output format — the action prefixes by PATH, not component. See
# meridian@fix/release-please-output-key for the full rationale.)
release_created: ${{ steps.release.outputs.releases_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
# include-component-in-tag ensures tags look like
# `meridian-plugin-pi-scrub-v1.2.3`, which lets release-please
# find the previous release on each run. Without this the action
# recomputes from full history every cycle.
include-component-in-tag: true
publish:
needs: release-please
# release-please's `releases_created` output is a STRING ("true"/"false"),
# so a bare truthy check fires on every push (even when no release was
# created) and ends in E403 trying to re-publish the existing version.
# Compare to the literal 'true' string to only publish when release-please
# actually cut a release. publish_only is a real boolean from
# workflow_dispatch input, so it can stay as-is.
if: ${{ always() && (needs.release-please.outputs.release_created == 'true' || inputs.publish_only == true) }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "22"
registry-url: "https://registry.npmjs.org"
- run: npm install --global npm@11.19.1
- uses: oven-sh/setup-bun@v2
with:
bun-version: "1.3.14"
- run: npm ci
- run: npm test
- run: npm run build
- run: npm publish --provenance --access public