-
Notifications
You must be signed in to change notification settings - Fork 140
88 lines (73 loc) · 3.03 KB
/
auto_create_version_bump_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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
name: Auto version bump on release completed
on:
release:
types: [published]
jobs:
bump_version:
# If this is a hotfix release, _don't_ do a version bump
# If this is a 1.x release, do the version bump in the release/1.x branch
# If this is a 2.x release, do the version bump in the release/2.x branch
# If this is a 3.x.0 release, do the version bump on master
if: endsWith(github.event.release.tag_name, '.0') || endsWith(github.event.release.tag_name, '.0-prerelease')
runs-on: windows-latest
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
steps:
- name: Support longpaths
run: git config --system core.longpaths true
- name: "Select branch"
id: select_branch
run: |
if( "${{ github.event.release.tag_name}}".StartsWith("v1.")) {
echo "::set-output name=ref::release/1.x"
# TODO: Uncomment the following once we cut the release/2.x branch and merge v3
# } elseif("${{ github.event.release.tag_name}}".StartsWith("v2.")) {
# echo "::set-output name=ref::release/2.x"
} else {
echo "::set-output name=ref::master"
}
- name: Checkout
uses: actions/checkout@v2
with:
ref: ${{ steps.select_branch.outputs.ref }}
- name: "Configure Git Credentials"
run: |
git config user.name "${{ github.actor }}"
git config user.email "${{ github.actor }}@users.noreply.github.com"
- uses: actions/setup-dotnet@v1
with:
dotnet-version: '8.0.100'
- name: "Update Changelog"
run: .\tracer\build.ps1 UpdateChangeLog
env:
RELEASE_NOTES: ${{ github.event.release.body }}
- name: "CalculateNextVersion"
run: .\tracer\build.ps1 CalculateNextVersion
id: versions
- name: "Bump Version"
run: .\tracer\build.ps1 UpdateVersion
env:
NewVersion: ${{ steps.versions.outputs.version }}
NewIsPrerelease: ${{ steps.versions.outputs.isprerelease }}
- name: "Verify Changes"
id: changes
run: .\tracer\build.ps1 VerifyChangedFilesFromVersionBump
- name: Create Pull Request
id: pr
uses: peter-evans/create-pull-request@v3.10.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: "version-bump-${{steps.versions.outputs.full_version}}"
commit-message: "[Version Bump] ${{steps.versions.outputs.full_version}}"
delete-branch: true
title: "[Version Bump] ${{steps.versions.outputs.full_version}}"
reviewers: "DataDog/apm-dotnet"
body: "${{steps.changes.outputs.release_notes}}"
- name: "Close previous milestone"
run: .\tracer\build.ps1 CloseMilestone
env:
Version: ${{steps.versions.outputs.previous_version}}
- name: Display output
run: |
echo "Pull Request Number - ${{ steps.pr.outputs.pull-request-number }}"
echo "Pull Request URL - ${{ steps.pr.outputs.pull-request-url }}"