- add automated build to create release notes

This commit is contained in:
Mike Penz
2020-10-16 19:51:58 +02:00
parent 07752c8758
commit cabe95c7ad
+31 -8
View File
@@ -1,13 +1,13 @@
name: 'build-test' name: 'CI'
on: # rebuild any PRs and main branch changes on:
pull_request:
push: push:
branches: tags:
- main - '*'
- 'releases/*' pull_request:
jobs: jobs:
build: # make sure build/ci work properly build:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
@@ -18,7 +18,8 @@ jobs:
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
test: # make sure the action works on a clean machine without building test:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
@@ -48,3 +49,25 @@ jobs:
- name: Echo Complex - name: Echo Complex
run: echo "${{steps.complex_release.outputs.changelog}}" run: echo "${{steps.complex_release.outputs.changelog}}"
release:
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Checkout full depth so tags can be discovered automatically if not specified
- name: "Build Changelog"
id: github_release
uses: mikepenz/release-changelog-builder-action@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release
uses: actions/create-release@v1
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
body: ${{steps.github_release.outputs.changelog}}
prerelease: ${{ contains(github.ref, '-rc') || contains(github.ref, '-b') || contains(github.ref, '-a') }}