-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (57 loc) · 2.44 KB
/
Copy pathrelease.yml
File metadata and controls
63 lines (57 loc) · 2.44 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
name: Release
# Automated semantic versioning driven by Conventional Commits.
#
# Model: release-PR, not release-on-push. Every push to main updates (or opens) a
# single "chore(main): release X.Y.Z" pull request that carries the computed
# version bump, the regenerated CHANGELOG.md, and the package.json/package-lock
# version. Nothing is tagged or published until a human merges that PR — which is
# the point: a live, judged deployment should never be version-bumped by a robot
# that nobody looked at. Merging the PR is what cuts the git tag and the GitHub
# Release, and that merge commit also re-runs CI + the production deploy.
#
# Baseline is 0.1.0 (see .release-please-manifest.json): the version package.json
# has carried since the first commit. There are no tags in this repo's history, so
# the first release PR computes its bump from every commit ever made and the first
# CHANGELOG.md covers the whole build.
on:
push:
branches: [main]
workflow_dispatch:
permissions:
contents: write
pull-requests: write
# Never let two release-please runs race on the same release PR.
concurrency:
group: release-please-${{ github.ref }}
cancel-in-progress: false
jobs:
release-please:
name: "Release PR / tag"
runs-on: ubuntu-latest
steps:
- name: Run release-please
id: release
uses: googleapis/release-please-action@v5
with:
# The built-in token is enough: this repo publishes nothing to npm and
# needs no cross-repo access.
token: ${{ secrets.GITHUB_TOKEN }}
config-file: release-please-config.json
manifest-file: .release-please-manifest.json
# Outputs go through the environment, never through ${{ }} interpolation:
# `pr` is a JSON blob containing the whole PR body, which the shell would
# otherwise try to parse as code.
- name: Summarise
if: always()
env:
RELEASE_CREATED: ${{ steps.release.outputs.release_created }}
TAG_NAME: ${{ steps.release.outputs.tag_name }}
PR_NUMBER: ${{ steps.release.outputs.prs_created }}
run: |
if [ "$RELEASE_CREATED" = "true" ]; then
echo "Released \`${TAG_NAME}\`" >> "$GITHUB_STEP_SUMMARY"
elif [ "$PR_NUMBER" = "true" ]; then
echo "Release PR opened / updated." >> "$GITHUB_STEP_SUMMARY"
else
echo "No releasable commits since the last release." >> "$GITHUB_STEP_SUMMARY"
fi