-
Notifications
You must be signed in to change notification settings - Fork 3
66 lines (58 loc) · 1.92 KB
/
Copy pathrelease-please.yml
File metadata and controls
66 lines (58 loc) · 1.92 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:
permissions:
contents: write
pull-requests: write
jobs:
release-please:
name: Release Please
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release.outputs.release_created }}
tag_name: ${{ steps.release.outputs.tag_name }}
version: ${{ steps.release.outputs.version }}
pr: ${{ steps.release.outputs.pr }}
steps:
- name: Run release-please
uses: googleapis/release-please-action@v4
id: release
with:
token: ${{ secrets.GITHUB_TOKEN }}
config-file: release-please-config.json
manifest-file: .release-please-manifest.json
- name: Checkout repository
if: ${{ steps.release.outputs.pr }}
uses: actions/checkout@v4
with:
ref: ${{ fromJson(steps.release.outputs.pr).headBranchName }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Node.js
if: ${{ steps.release.outputs.pr }}
uses: actions/setup-node@v4
with:
node-version: 20
- name: Sync npm package versions
if: ${{ steps.release.outputs.pr }}
run: node scripts/sync-versions.js
- name: Commit synced versions
if: ${{ steps.release.outputs.pr }}
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add npm/
if git diff --staged --quiet; then
echo "No version changes to commit"
else
git commit -m "chore: sync npm package versions"
git push
fi
- name: Output release info
if: ${{ steps.release.outputs.release_created }}
run: |
echo "Release created!"
echo "Tag: ${{ steps.release.outputs.tag_name }}"
echo "Version: ${{ steps.release.outputs.version }}"