forked from open-telemetry/opentelemetry-js-contrib
-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (64 loc) · 2.27 KB
/
release-please.yml
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
69
70
71
72
73
on:
push:
branches:
- main
name: Run Release Please
jobs:
release-please:
runs-on: ubuntu-latest
steps:
# The logic below handles the npm publication:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 18
registry-url: 'https://registry.npmjs.org'
- name: Install packages
run: |
npm ci
- uses: google-github-actions/release-please-action@v3
id: release
with:
command: manifest
token: ${{secrets.RELEASE_PR_TOKEN}}
default-branch: main
# get release PR as we're currently on main
- name: Checkout release PR
# only checkout if a PR has been created, otherwise this will fail
if: ${{ steps.release.outputs.pr }}
uses: actions/checkout@v4
with:
ref: release-please--branches--main
# use a token so that workflows on the PR run when we push later
token: ${{ secrets.RELEASE_PR_TOKEN }}
# release-please does not do this on its own, so we do it here instead
- name: Update package-lock.json in PR
# only update if a PR has been created
if: ${{ steps.release.outputs.pr }}
run: |
npm install --ignore-scripts --package-lock-only
git add package-lock.json
git config user.name opentelemetrybot
git config user.email [email protected]
git commit -m "chore: sync package-lock.json"
git push
# get main again
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Rebuild Packages
run: |
npm ci
npm run compile
# Release Please has already incremented versions and published tags, so we just
# need to publish all unpublished versions to npm here
# See: https://github.com/lerna/lerna/tree/main/commands/publish#bump-from-package
- name: Publish to npm
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
run: npx lerna publish from-package --no-push --no-private --no-git-tag-version --no-verify-access --yes