Skip to content

create-release

create-release #237

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' && startsWith(github.ref, 'refs/tags/') }}
container:
image: golang:1.16
steps:
- name: Check out a copy of the repo
uses: actions/checkout@v2
with:
fetch-depth: 0
- id: get_version
uses: battila7/get-version-action@v2
- name: set vars to github
run: |
echo "APP_TAG=${{ steps.get_version.outputs.version-without-v }}" >> $GITHUB_ENV
- 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 \
${{ env.APP_TAG }}
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
with:
tag_name: ${{ env.APP_TAG }}
release_name: ${{ env.APP_TAG }}
draft: true
prerelease: false
body_path: RELEASE_CHANGELOG.md