parse json object instead of passing string #75
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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') | ||
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 }}" |