Skip to content

create-release

create-release #192

Workflow file for this run

name: create-release
on:
workflow_run:
workflows: ['lint-code']
types:
- completed
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
# https://semver.org/ proper release tags, more or less
- 'v[0-9]+.[0-9]+.[0-9]+'
# prerelease tags, more or less
- 'v[0-9]+.[0-9]+.[0-9]+-*'
jobs:
release:
runs-on: ubuntu-20.04
if: ${{ github.event.workflow_run.conclusion == 'success' }}
container:
image: golang:1.16
steps:
- name: Check out a copy of the repo
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: show tag
id: tag
run: |
echo ::set-output name=TAG::${GITHUB_REF##*/}
- name: install
run: |
go get github.com/git-chglog/git-chglog/cmd/git-chglog
- name: generate changelog
run: |
# https://github.com/git-chglog/git-chglog#git-chglog
$(go env GOPATH)/bin/git-chglog \
-c .chglog/config.yml \
-o RELEASE_CHANGELOG.md \
${{ steps.tag.outputs.TAG }}
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
with:
tag_name: ${{ steps.tag.outputs.TAG }}
release_name: ${{ steps.tag.outputs.TAG }}
draft: true
prerelease: false
body_path: RELEASE_CHANGELOG.md