mirror of https://github.com/thumbsup/thumbsup
parent
20e4b160fe
commit
dee262524b
@ -0,0 +1,31 @@
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
|
||||
name: Create Release
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Create Release
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 100
|
||||
- name: Get the version
|
||||
id: version
|
||||
run: echo ::set-output name=tag::${GITHUB_REF:10}
|
||||
- name: Generate change log
|
||||
run: scripts/changelog ${{ steps.version.outputs.tag }} > CHANGELOG.md
|
||||
- name: Create Release
|
||||
uses: actions/create-release@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
tag_name: ${{ github.ref }}
|
||||
release_name: "Release ${{ steps.version.outputs.tag }}"
|
||||
body_path: CHANGELOG.md
|
||||
draft: false
|
||||
prerelease: false
|
@ -0,0 +1,16 @@
|
||||
#!/bin/bash -e
|
||||
|
||||
current_tag="$1"
|
||||
if [ -z "${current_tag}" ]; then
|
||||
echo "Displays changes since previous tag"
|
||||
echo "Usage: changelog <current tag>"
|
||||
echo "Examples:"
|
||||
echo " changelog HEAD"
|
||||
echo " changelog 2.15.0"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
previous_tag=$(git describe --tags --abbrev=0 "${current_tag}^")
|
||||
|
||||
format="- %s ([%h](https://github.com/thumbsup/thumbsup/commit/%h))"
|
||||
git log --pretty=format:"${format}" "${previous_tag}".."${current_tag}"
|
Loading…
Reference in New Issue