generated from actions/javascript-action
-
Notifications
You must be signed in to change notification settings - Fork 25
42 lines (41 loc) · 1.3 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: "Release Workflow"
on:
push:
branches:
- 'master'
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Read version
id: read_version
run: |
echo ::set-output name=version::$(cat VERSION)
shell: bash
- name: Get Changelog Entry
id: changelog_reader
uses: mindsers/changelog-reader-action@v1
with:
version: ${{ steps.read_version.outputs.version }}
path: ./CHANGELOG.md
- name: Check for Release
id: check_release
run: |
TAG=$(git tag -l ${{ steps.read_version.outputs.version }})
MISSING=$([[ -z "$TAG" ]] && echo 'true' || echo 'false')
echo ::set-output name=missing::$MISSING
shell: bash
- name: Create Release
if: ${{ steps.check_release.outputs.missing == 'true' }}
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.read_version.outputs.version }}
release_name: Changelog Enforcer ${{ steps.read_version.outputs.version }}
body: ${{ steps.changelog_reader.outputs.log_entry }}
draft: false
prerelease: false