Skip to content

Commit

Permalink
Add automatic GH release creation on tag push (#163)
Browse files Browse the repository at this point in the history
* Add automatic GH release creation on tag push

* Add documentation

* Fix documentation

* Replace release creating with gh tool; add release notes generation

* Fix artifacts

* Fix documentation

* Fix needs section

Co-authored-by: Chris Ventura <45495992+nrcventura@users.noreply.github.com>
  • Loading branch information
dszmigielski and nrcventura authored May 11, 2021
1 parent ac58b86 commit 6e11d00
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
24 changes: 24 additions & 0 deletions .github/workflows/artifacts.yml → .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: Build artifacts
on:
push:
branches: [ main ]
tags:
- 'v*.*.*'
pull_request:
branches: [ main ]
workflow_dispatch:
Expand Down Expand Up @@ -78,3 +80,25 @@ jobs:
with:
name: artifacts
path: otel-dotnet-autoinstrumentation-macos.tar

create_release:
runs-on: ubuntu-20.04
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') # only trigger if the current event is for a tag push
needs: [alpine_build, linux_build, windows_build, macos_build]
permissions:
contents: write
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v2
with:
path: .
- name: Extract tag name
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\/v}
- name: Extract release notes
run: awk '/## \[${{ steps.get_version.outputs.VERSION }}\]/,0' docs/CHANGELOG.md >> notes.md
- run: gh release create v${{ steps.get_version.outputs.VERSION }} -F notes.md artifacts/otel* artifacts/x64/en-us/opentelemetry* artifacts/x86/en-us/opentelemetry*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}


6 changes: 5 additions & 1 deletion docs/RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,8 @@

To change the version the following steps have to be executed:
* Update the version number in [TracerVersion.cs](https://github.com/open-telemetry/opentelemetry-dotnet-instrumentation/blob/main/tools/Datadog.Core.Tools/TracerVersion.cs).
* Run the [PrepareRelease tool](https://github.com/open-telemetry/opentelemetry-dotnet-instrumentation/tree/main/build/tools/PrepareRelease): `dotnet run msi versions integrations`.
* Run the [PrepareRelease tool](https://github.com/open-telemetry/opentelemetry-dotnet-instrumentation/tree/main/build/tools/PrepareRelease): `dotnet run msi versions integrations`.

## Release

To create GitHub release the git tag with correct version number has to be pushed (format is `v\d.\d.\d`, it must match the version prepared in Pre-Release steps). The release will be created automatically by the GitHub Actions workflow with the release notes based on the [CHANGELOG.md](CHANGELOG.md).

0 comments on commit 6e11d00

Please sign in to comment.