diff --git a/.github/workflows/artifacts.yml b/.github/workflows/workflow.yml similarity index 68% rename from .github/workflows/artifacts.yml rename to .github/workflows/workflow.yml index 07e699a6d8..add0f1a1ed 100644 --- a/.github/workflows/artifacts.yml +++ b/.github/workflows/workflow.yml @@ -2,6 +2,8 @@ name: Build artifacts on: push: branches: [ main ] + tags: + - 'v*.*.*' pull_request: branches: [ main ] workflow_dispatch: @@ -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 }} + + diff --git a/docs/RELEASING.md b/docs/RELEASING.md index 853ac7e5d1..18c3ba3740 100644 --- a/docs/RELEASING.md +++ b/docs/RELEASING.md @@ -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`. \ No newline at end of file +* 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). \ No newline at end of file