|
| 1 | +name: "On Version Bump Merged" |
| 2 | +on: |
| 3 | + pull_request: |
| 4 | + types: |
| 5 | + - closed |
| 6 | + |
| 7 | +jobs: |
| 8 | + if_merged: |
| 9 | + if: github.event.pull_request.merged == true && startsWith(github.event.pull_request.title, '[Version Bump]') == true |
| 10 | + runs-on: ubuntu-latest |
| 11 | + steps: |
| 12 | + # Create release branch |
| 13 | + - name: Checkout |
| 14 | + uses: actions/checkout@v2 |
| 15 | + with: |
| 16 | + fetch-depth: 0 |
| 17 | + |
| 18 | + - uses: actions/setup-dotnet@v1 |
| 19 | + with: |
| 20 | + dotnet-version: '7.0.101' |
| 21 | + |
| 22 | + - name: "Configure Git Credentials" |
| 23 | + run: | |
| 24 | + git config user.name "${{ github.actor }}" |
| 25 | + git config user.email "${{ github.actor }}@users.noreply.github.com" |
| 26 | +
|
| 27 | + - name: "Get current version" |
| 28 | + id: versions |
| 29 | + run: ./github-actions-helpers/build.sh OutputCurrentVersionToGitHub |
| 30 | + |
| 31 | + # Create release branch |
| 32 | + - name: "Push ddtrace branch" |
| 33 | + run: | |
| 34 | + git checkout -b ddtrace-${{ steps.versions.outputs.version }} |
| 35 | + git add . |
| 36 | + git commit -m "New release ${{steps.versions.outputs.version}}" |
| 37 | + git push origin -u ddtrace-${{ steps.versions.outputs.version }} |
| 38 | +
|
| 39 | + - name: "Generate release notes" |
| 40 | + id: release_notes |
| 41 | + run: ./github-actions-helpers/build.sh GenerateReleaseNotes |
| 42 | + env: |
| 43 | + PIPELINE_ARTIFACTS_LINK: ${{steps.assets.outputs.artifacts_link}} |
| 44 | + |
| 45 | + - name: Create Release |
| 46 | + uses: softprops/action-gh-release@v1 |
| 47 | + with: |
| 48 | + draft: true |
| 49 | + name: "${{steps.versions.outputs.full_version}}" |
| 50 | + tag_name: "${{steps.versions.outputs.full_version}}" |
| 51 | + prerelease: ${{steps.versions.outputs.isprerelease}} |
| 52 | + body: ${{steps.release_notes.outputs.release_notes}} |
| 53 | + target_commitish: "ddtrace-${{steps.versions.outputs.full_version}}" |
| 54 | + fail_on_unmatched_files: true |
0 commit comments