|
20 | 20 | node-version: 18 |
21 | 21 | registry-url: 'https://registry.npmjs.org' |
22 | 22 |
|
23 | | - - name: Build Packages |
| 23 | + - name: Install packages |
24 | 24 | run: | |
25 | 25 | npm ci |
26 | | - npm run compile |
27 | 26 |
|
28 | 27 | - uses: google-github-actions/release-please-action@v3 |
29 | 28 | id: release |
|
32 | 31 | token: ${{secrets.RELEASE_PR_TOKEN}} |
33 | 32 | default-branch: main |
34 | 33 |
|
| 34 | + # get release PR as we're currently on main |
| 35 | + - name: Checkout release PR |
| 36 | + # only checkout if a PR has been created, otherwise this will fail |
| 37 | + if: ${{ steps.release.outputs.pr }} |
| 38 | + uses: actions/checkout@v4 |
| 39 | + with: |
| 40 | + ref: release-please--branches--main |
| 41 | + # use a token so that workflows on the PR run when we push later |
| 42 | + token: ${{ secrets.RELEASE_PR_TOKEN }} |
| 43 | + |
| 44 | + # release-please does not do this on its own, so we do it here instead |
| 45 | + - name: Update package-lock.json in PR |
| 46 | + env: |
| 47 | + GITHUB_TOKEN: ${{ secrets.RELEASE_PR_TOKEN }} |
| 48 | + # only update if a PR has been created |
| 49 | + if: ${{ steps.release.outputs.pr }} |
| 50 | + run: | |
| 51 | + npm install --ignore-scripts --package-lock-only |
| 52 | + git add package-lock.json |
| 53 | + git config user.name opentelemetrybot |
| 54 | + git config user.email [email protected] |
| 55 | + git commit -m "chore: sync package-lock.json" |
| 56 | + git push |
| 57 | +
|
| 58 | + # get main again |
| 59 | + - name: Checkout Repository |
| 60 | + uses: actions/checkout@v4 |
| 61 | + with: |
| 62 | + fetch-depth: 0 |
| 63 | + |
| 64 | + - name: Rebuild Packages |
| 65 | + run: | |
| 66 | + npm ci |
| 67 | + npm run compile |
| 68 | +
|
35 | 69 | # Release Please has already incremented versions and published tags, so we just |
36 | 70 | # need to publish all unpublished versions to npm here |
37 | 71 | # See: https://github.com/lerna/lerna/tree/main/commands/publish#bump-from-package |
|
0 commit comments