Skip to content

Automated Release Notes Generation #5500

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Mar 31, 2021
13 changes: 0 additions & 13 deletions .github/workflows/integration-jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,6 @@ jobs:
fail-fast: false
matrix:
stack_version: [
'7.0.0',
'7.1.0',
'7.2.0',
'7.3.0',
'7.4.0',
'7.5.0',
'7.6.0',
'7.7.0',
'7.8.0',
'7.9.0',
'7.10.0',
'7.11.0',
'7.12.0-SNAPSHOT',
'latest-7'
]

Expand Down
83 changes: 83 additions & 0 deletions .github/workflows/make-release-notes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Release-Notes
on:
workflow_dispatch:
inputs:
branch:
description: 'The branch to generate release notes on'
required: true
schedule:
- cron: "0 0/12 * * *"

jobs:

active-branches:
runs-on: ubuntu-latest
env:
TASK_BRANCH: ${{ github.event.inputs.branch }}

steps:
- id: dump-branches
name: get branches from artifacts api
if: ${{ ! github.event.inputs.branch }}
run: |
curl -s "https://artifacts-api.elastic.co/v1/branches" | jq "[ .branches[] | select(. | startswith(\"6\") | not) ]" --compact-output
curl -s "https://artifacts-api.elastic.co/v1/branches" | jq "[ .branches[] | select(. | startswith(\"6\") | not) ]" --compact-output > branches.json

- id: set-matrix
name: conditional command
run: |
if [[ "${{ github.event.inputs.branch }}" != "" ]]; then
echo "::set-output name=matrix::['${{ github.event.inputs.branch }}']"
elif [[ -f "branches.json" ]]; then
echo "::set-output name=matrix::$(cat branches.json)"
else
echo "::set-output name=matrix::[]"
fi
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}

release-notes:
name: Generate
needs: active-branches
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
branch: ${{ fromJson(needs.active-branches.outputs.matrix) }}
steps:
- uses: actions/checkout@v2
with:
ref: "${{ matrix.branch }}"

- uses: actions/setup-dotnet@v1
with:
dotnet-version: '5.0.100'
- name: Install dotnet-script
run: dotnet tool install release-notes --tool-path dotnet-tool

- name: Find versions for branch
id: versions
run: |
readarray -t lines < <(dotnet-tool/release-notes "${{ github.event.organization.login }}" "${{ github.event.repository.name }}" current-version --query "${{ matrix.branch }}" --version 0.0.1 --token ${{ secrets.GITHUB_TOKEN }} --releasetagformat VERSION)
echo "::set-output name=current::$(echo ${lines[0]})"
echo "::set-output name=next::$(echo ${lines[1]})"
echo ${lines[@]}

- name: Generate release notes
run: |
dotnet-tool/release-notes "${{ github.event.organization.login }}" "${{ github.event.repository.name }}" --version ${{ steps.versions.outputs.next }} --token ${{ secrets.GITHUB_TOKEN }} --format asciidoc --output docs/release-notes
rm dotnet-tool/release-notes
git status
- name: "PR ${{ matrix.branch }}"
# fixate to known release.
uses: peter-evans/create-pull-request@052fc72b4198ba9fbc81b818c6e1859f747d49a8
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: "fix/${{ matrix.branch }}/release-notes"
base: "${{ matrix.branch }}"
delete-branch: true
commit-message: "[release-notes] Release notes ${{ steps.versions.outputs.next }} on ${{ matrix.branch }} branch"
title: '[release-notes] Release notes ${{ steps.versions.outputs.next }} on ${{ matrix.branch }} branch'
body: |
Release notes ${{ steps.versions.outputs.next }} on ${{ matrix.branch }} branch
labels: "infra,code-gen"
1 change: 1 addition & 0 deletions build/scripts/scripts.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
<Content Include="..\..\.github\workflows\unified-release.yml"><Link>unified-release.yml</Link></Content>
<Content Include="..\..\.github\workflows\make-codegen.yml"><Link>make-codegen.yml</Link></Content>
<Content Include="..\..\.github\workflows\make-bump.yml"><Link>make-bump.yml</Link></Content>
<Content Include="..\..\.github\workflows\make-release-notes.yml"><Link>make-release-notes.yml</Link></Content>
</ItemGroup>
<ItemGroup>
<PackageReference Include="FSharp.Core" Version="5.0.0" />
Expand Down