-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (46 loc) · 1.39 KB
/
Copy pathcreate_release.yml
File metadata and controls
54 lines (46 loc) · 1.39 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
name: CreateRelease
on:
push:
branches-ignore:
- '**'
tags:
- 'v**'
jobs:
create_release:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- name: Checkout
uses: actions/checkout@v2
with:
persist-credentials: true
fetch-depth: 0
- name: last tag
id: lasttag
run: |
git fetch --tags -f
LAST_TAG=$(git tag --sort=-creatordate | head -n 2 | tail -n 1)
echo "::set-output name=last_tag::${LAST_TAG}"
- name: changelog
uses: scottbrenner/generate-changelog-action@master
id: Changelog
with:
args: "-t ${{ steps.lasttag.outputs.last_tag }}"
env:
REPO: ${{ github.repository }}
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.FL_WORKFLOW_PAT }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: |
${{ steps.Changelog.outputs.changelog }}
draft: false
prerelease: false