Skip to content

Commit 9897e99

Browse files
Release github workflow
Update inspec.yml prior to generate changelog. That way, the changelog push will do for both. Signed-off-by: Michée Lengronne <michee.lengronne@coppint.com>
1 parent 5d8da16 commit 9897e99

1 file changed

Lines changed: 55 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: New release
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
generate_changelog:
10+
runs-on: ubuntu-latest
11+
name: create release draft
12+
steps:
13+
- uses: actions/checkout@v1
14+
15+
- name: 'Get Previous tag'
16+
id: previoustag
17+
uses: "WyriHaximus/github-action-get-previous-tag@master"
18+
env:
19+
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
20+
21+
- name: calculate next version
22+
id: version
23+
uses: charmixer/auto-changelog-action@8095796
24+
env:
25+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26+
27+
- name: update inspec.yml
28+
uses: mikefarah/yq@3.2.1
29+
with:
30+
cmd: yq w -I4 -i inspec.yml version ${{ steps.version.outputs.next-version }} && sed -i '1i---' inspec.yml
31+
32+
- name: Generate changelog
33+
uses: charmixer/auto-changelog-action@v1
34+
with:
35+
token: ${{ secrets.GITHUB_TOKEN }}
36+
since_tag: ${{ steps.previoustag.outputs.tag }}
37+
future_release: ${{ steps.version.outputs.next-version }}
38+
39+
- name: Read CHANGELOG.md
40+
id: package
41+
uses: juliangruber/read-file-action@v1
42+
with:
43+
path: ./CHANGELOG.md
44+
45+
- name: Create Release draft
46+
id: create_release
47+
uses: actions/create-release@v1
48+
env:
49+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
50+
with:
51+
release_name: ${{ steps.version.outputs.next-version }}
52+
tag_name: ${{ steps.version.outputs.next-version }}
53+
body: |
54+
${{ steps.package.outputs.content }}
55+
draft: true

0 commit comments

Comments
 (0)