forked from open-telemetry/opentelemetry-js-contrib
63 lines (56 loc) · 2.3 KB
/
release-pr.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
name: Create New Release PR
on:
workflow_dispatch:
inputs:
version:
description: The semver-compliant version to tag the release with, e.g. 1.2.3, 1.0.0-rc.1
required: true
jobs:
create_release_pr:
name: Create Release PR and Draft Release
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: '14.x'
- name: Cache Dependencies
uses: actions/cache@v2
with:
path: |
node_modules
package-lock.json
detectors/node/*/node_modules
metapackages/*/node_modules
packages/*/node_modules
plugins/node/*/node_modules
plugins/web/*/node_modules
propagators/*/node_modules
key: ${{ runner.os }}-${{ matrix.container }}-${{ hashFiles('**/package.json') }}
# Bump versions in all package.json and version.ts files
- name: Prepare Release
run: |
npm install
npm --no-git-tag-version version ${{ github.event.inputs.version }}
npx lerna publish ${{ github.event.inputs.version }} --skip-npm --no-git-tag-version --no-push --yes
npx lerna bootstrap --no-ci
- name: Update Changelog
env:
GITHUB_AUTH: ${{ secrets.GITHUB_TOKEN }}
run: ./scripts/changelog-update.sh ${{ github.event.inputs.version }}
# Make PR with version bumps and changelog update. Merging this PR triggers publish workflow.
# See: https://github.com/open-telemetry/opentelemetry-js-contrib/blob/main/.github/workflows/publish.yml
- name: Create Release PR
uses: peter-evans/create-pull-request@v3
with:
branch: release/${{ github.event.inputs.version }}
commit-message: 'chore: ${{ github.event.inputs.version }} release proposal'
title: 'chore: ${{ github.event.inputs.version }} release proposal'
body: |
This is an auto-generated release PR. If additional changes need to be incorporated before the release, the CHANGELOG must be updated manually.
Merging this PR will automatically release all packages to NPM.
delete-branch: true