1
+ ---
1
2
name : New release
2
3
3
- on :
4
+ on : # yamllint disable-line rule:truthy
5
+ workflow_dispatch :
4
6
push :
5
7
branches :
6
8
- master
10
12
runs-on : ubuntu-latest
11
13
name : create release draft
12
14
steps :
13
- - uses : actions/checkout@v2
15
+ - uses : actions/checkout@v3
14
16
with :
15
17
fetch-depth : 0
18
+ ref : master
16
19
17
20
- name : ' Get Previous tag'
18
21
id : previoustag
@@ -32,56 +35,46 @@ jobs:
32
35
token : ${{ secrets.GITHUB_TOKEN }}
33
36
future_release : ${{ steps.version.outputs.next-version }}
34
37
35
- - name : Generate changelog for the release
36
- uses : charmixer/auto-changelog-action@v1
37
- with :
38
- token : ${{ secrets.GITHUB_TOKEN }}
39
- since_tag : ${{ steps.previoustag.outputs.tag }}
40
- future_release : ${{ steps.version.outputs.next-version }}
41
- output : CHANGELOGRELEASE.md
42
38
43
39
- name : update inspec.yml
44
40
uses : mikefarah/yq@3.2.1
45
41
with :
46
42
cmd : yq w -I4 -i inspec.yml version ${{ steps.version.outputs.next-version }} && sed -i '1i---' inspec.yml
47
43
48
44
- name : push inspec.yml and changelog
49
- uses : github-actions-x/commit@v2.6
45
+ uses : github-actions-x/commit@v2.9
50
46
with :
51
47
github-token : ${{ secrets.GITHUB_TOKEN }}
52
48
push-branch : ' master'
53
49
commit-message : ' update inspec.yml and changelog'
54
50
files : inspec.yml CHANGELOG.md
55
51
name : dev-sec CI
56
52
email : hello@dev-sec.io
57
- rebase : ' true'
53
+ force-add : ' true'
54
+
55
+ - name : Generate changelog for the release
56
+ run : |
57
+ sed '/## \[${{ steps.previoustag.outputs.tag }}\]/Q' CHANGELOG.md > CHANGELOGRELEASE.md
58
58
59
59
- name : Read CHANGELOG.md
60
60
id : package
61
61
uses : juliangruber/read-file-action@v1
62
62
with :
63
63
path : ./CHANGELOGRELEASE.md
64
64
65
- - uses : actions/checkout@v2
66
- with :
67
- ref : master
68
-
69
- - name : Get current commitish
70
- id : current_commitish
71
- run : echo "::set-output name=sha::$(git log -1 --format="%H")"
72
-
73
- - name : Check it
74
- run : echo ${{ steps.current_commitish.outputs.sha }}
65
+ - name : Delete old drafts
66
+ uses : hugo19941994/delete-draft-releases@v1.0.0
67
+ env :
68
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
75
69
76
70
- name : Create Release draft
77
71
id : create_release
78
- uses : actions/create-release@v1.1.2
72
+ uses : actions/create-release@v1
79
73
env :
80
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
74
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
81
75
with :
82
76
release_name : ${{ steps.version.outputs.next-version }}
83
77
tag_name : ${{ steps.version.outputs.next-version }}
84
78
body : |
85
79
${{ steps.package.outputs.content }}
86
- commitish : ${{ steps.current_commitish.outputs.sha }}
87
80
draft : true
0 commit comments