-
Notifications
You must be signed in to change notification settings - Fork 1
66 lines (61 loc) · 2.07 KB
/
release-please.yml
File metadata and controls
66 lines (61 loc) · 2.07 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]
tags:
- "v*.*.*"
workflow_dispatch:
inputs:
action:
description: What to do (check verifies OIDC without publishing)
required: true
type: choice
default: check
options:
- check
- publish
publish_ref:
description: Git ref to publish (for example tag v0.2.2). Leave empty to publish the workflow ref.
required: false
type: string
default: ""
permissions:
contents: write
id-token: write
pull-requests: write
jobs:
release-please:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release.outputs.release_created }}
tag_name: ${{ steps.release.outputs.tag_name }}
steps:
- uses: googleapis/release-please-action@16a9c90856f42705d54a6fda1823352bdc62cf38 # v4.4.0
id: release
with:
config-file: release-please-config.json
manifest-file: .release-please-manifest.json
# npm trusted publishing validates the calling workflow name for
# workflow_dispatch/workflow_call flows, so release-please.yml must remain the
# top-level entrypoint for both automatic and manual publish paths.
publish-release:
if: needs.release-please.outputs.release_created == 'true'
needs:
- release-please
permissions:
contents: read
id-token: write
uses: ./.github/workflows/publish.yml
with:
action: publish
publish_ref: ${{ needs.release-please.outputs.tag_name }}
publish-manual-or-tag:
if: github.event_name == 'workflow_dispatch' || startsWith(github.ref, 'refs/tags/v')
permissions:
contents: read
id-token: write
uses: ./.github/workflows/publish.yml
with:
action: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.action || 'publish' }}
publish_ref: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.publish_ref != '' && github.event.inputs.publish_ref || github.ref }}