ci: Add autogenerated release notes

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
pull/152/head
Dave Tucker 3 years ago
parent 923cd9b767
commit dc16739b06

@ -0,0 +1,31 @@
{
"categories": [
{
"title": "## 🚀 Features",
"labels": ["feature"],
"exhaustive": true
},
{
"title": "## 🐛 Fixes",
"labels": ["fix"],
"exhaustive": true
},
{
"title": "## 🧪 Tests",
"labels": ["test"],
"exhaustive": true
}
],
"ignore_labels": [
"ignore"
],
"tag_resolver": {
"filter": {
"pattern": "<from-workflow>"
},
"transformer": {
"pattern": "<from-workflow>",
"target": "$1"
}
}
}

@ -0,0 +1,13 @@
#!/bin/bash
# Remove "refs/tags/"
tag="${GITHUB_REF##*/}"
# Extract crate name
crate=$(echo $tag | sed 's/-v[0-9].*//g')
# Semver portion follows after the ${crate}-v
tagPattern="${crate}-v(.+)"
echo ::group::Configuring changelog generator
jq '.tag_resolver.filter.pattern="'$tagPattern'" | .tag_resolver.transformer.pattern="'$tagPattern'" | .categories[].labels += ["'$crate'"]' \
.github/changelog-base.json | tee .github/changelog-config.json
echo ::endgroup::

@ -0,0 +1,34 @@
name: 'release'
on:
push:
tags:
- '*'
jobs:
release:
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Prep Config
run: .github/prep-changelog-config.sh
- name: Build Changelog
id: github_release
uses: mikepenz/release-changelog-builder-action@v2
with:
configuration: ".github/changelog-config.json"
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}}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading…
Cancel
Save