Merge pull request #152 from dave-tucker/release-notes

ci: Add autogenerated release notes
pull/157/head
Alessandro Decina 3 years ago committed by GitHub
commit 2ea6d68544
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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