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,40 @@ 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
-
43
- - name : update inspec.yml
44
- uses : mikefarah/yq@3.2.1
45
- with :
46
- cmd : yq w -I4 -i inspec.yml version ${{ steps.version.outputs.next-version }} && sed -i '1i---' inspec.yml
47
-
48
- - name : push inspec.yml and changelog
49
- uses : github-actions-x/commit@v2.6
38
+ - name : push changelog
39
+ uses : github-actions-x/commit@v2.9
50
40
with :
51
41
github-token : ${{ secrets.GITHUB_TOKEN }}
52
42
push-branch : ' master'
53
- commit-message : ' update inspec.yml and changelog'
54
- files : inspec.yml CHANGELOG.md
43
+ commit-message : ' update changelog'
44
+ force-add : ' true'
45
+ files : CHANGELOG.md
55
46
name : dev-sec CI
56
47
email : hello@dev-sec.io
57
- rebase : ' true'
48
+
49
+ - name : Generate changelog for the release
50
+ run : |
51
+ sed '/## \[${{ steps.previoustag.outputs.tag }}\]/Q' CHANGELOG.md > CHANGELOGRELEASE.md
58
52
59
53
- name : Read CHANGELOG.md
60
54
id : package
61
55
uses : juliangruber/read-file-action@v1
62
56
with :
63
57
path : ./CHANGELOGRELEASE.md
64
58
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 }}
59
+ - name : Delete old drafts
60
+ uses : hugo19941994/delete-draft-releases@v1.0.0
61
+ env :
62
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
75
63
76
64
- name : Create Release draft
77
65
id : create_release
78
- uses : actions/create-release@v1.1.2
66
+ uses : actions/create-release@v1
79
67
env :
80
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
68
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
81
69
with :
82
70
release_name : ${{ steps.version.outputs.next-version }}
83
71
tag_name : ${{ steps.version.outputs.next-version }}
84
72
body : |
85
73
${{ steps.package.outputs.content }}
86
- commitish : ${{ steps.current_commitish.outputs.sha }}
87
74
draft : true
0 commit comments