Feature/changelog release (#131)
This commit is contained in:
41
.github/workflows/release.yml
vendored
Normal file
41
.github/workflows/release.yml
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
---
|
||||
name: release
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
tags:
|
||||
- "v*.*.*"
|
||||
|
||||
workflow_run:
|
||||
workflows: ["pre-commit"]
|
||||
types:
|
||||
- completed
|
||||
|
||||
jobs:
|
||||
release:
|
||||
name: Release Job
|
||||
runs-on: ubuntu-latest
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Install go (required for Changelog parsing)
|
||||
uses: actions/setup-go@v4
|
||||
|
||||
- name: Parse CHANGELOG.md
|
||||
run: |
|
||||
GO111MODULE=on go install github.com/rcmachado/changelog@0.7.0
|
||||
changelog show "$GITHUB_REF_NAME" > ${{ github.workspace }}-CHANGELOG.txt
|
||||
echo "Release note for $GITHUB_REF_NAME :"
|
||||
cat ${{ github.workspace }}-CHANGELOG.txt
|
||||
|
||||
- name: Release
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
body_path: ${{ github.workspace }}-CHANGELOG.txt
|
||||
files: |
|
||||
LICENSE
|
||||
CHANGELOG.md
|
||||
Reference in New Issue
Block a user