Skip to content

3.27.0

3.27.0 #131

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
permissions:
contents: write # Creates a branch
issues: write # Closes milestones
id-token: write # Required for dd-octo-sts authentication
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
steps:
- name: Support longpaths
run: git config --system core.longpaths true
- name: Get dd-octo-sts token
uses: DataDog/dd-octo-sts-action@acaa02eee7e3bb0839e4272dacb37b8f3b58ba80 # v1.0.3
id: octo-sts
with:
scope: DataDog/dd-trace-dotnet
policy: self.auto_create_version_bump_pr.create-pr
- name: "Select branch"
id: select_branch
run: |
if( "${{ github.event.release.tag_name}}".StartsWith("v1.")) {
echo "::set-output name=ref::release/1.x"
} 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@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
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@d4c94342e560b34958eacfc5d055d21461ed1c5d # v5.0.0
with:
global-json-file: global.json
- 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@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8
with:
token: ${{ steps.octo-sts.outputs.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 }}"