Skip to content

Commit 54afd07

Browse files
Merge pull request #157 from dev-sec/micheelengronne-patch-2
Release github workflow
2 parents 5d8da16 + bacaa37 commit 54afd07

1 file changed

Lines changed: 66 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
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: Generate changelog
28+
uses: charmixer/auto-changelog-action@v1
29+
with:
30+
token: ${{ secrets.GITHUB_TOKEN }}
31+
since_tag: ${{ steps.previoustag.outputs.tag }}
32+
future_release: ${{ steps.version.outputs.next-version }}
33+
34+
- name: update inspec.yml
35+
uses: mikefarah/yq@3.2.1
36+
with:
37+
cmd: yq w -I4 -i inspec.yml version ${{ steps.version.outputs.next-version }} && sed -i '1i---' inspec.yml
38+
39+
- name: push inspec.yml and changelog
40+
uses: github-actions-x/commit@v2.6
41+
with:
42+
github-token: ${{ secrets.GITHUB_TOKEN }}
43+
push-branch: 'master'
44+
commit-message: 'update inspec.yml and changelog'
45+
force-add: 'true'
46+
files: inspec.yml CHANGELOG.md
47+
name: dev-sec CI
48+
email: hello@dev-sec.io
49+
50+
- name: Read CHANGELOG.md
51+
id: package
52+
uses: juliangruber/read-file-action@v1
53+
with:
54+
path: ./CHANGELOG.md
55+
56+
- name: Create Release draft
57+
id: create_release
58+
uses: actions/create-release@v1
59+
env:
60+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
61+
with:
62+
release_name: ${{ steps.version.outputs.next-version }}
63+
tag_name: ${{ steps.version.outputs.next-version }}
64+
body: |
65+
${{ steps.package.outputs.content }}
66+
draft: true

0 commit comments

Comments
 (0)