|
1 | 1 | --- |
2 | | -name: New release |
| 2 | + name: New release |
3 | 3 |
|
4 | | -on: |
5 | | - push: |
6 | | - branches: |
7 | | - - master |
| 4 | + on: |
| 5 | + push: |
| 6 | + branches: |
| 7 | + - master |
8 | 8 |
|
9 | | -jobs: |
10 | | - generate_changelog: |
11 | | - runs-on: ubuntu-latest |
12 | | - name: create release draft |
13 | | - steps: |
14 | | - - uses: actions/checkout@v1 |
| 9 | + jobs: |
| 10 | + generate_changelog: |
| 11 | + runs-on: ubuntu-latest |
| 12 | + name: create release draft |
| 13 | + steps: |
| 14 | + - uses: actions/checkout@v2.3.4 |
| 15 | + with: |
| 16 | + fetch-depth: 0 |
15 | 17 |
|
16 | | - - name: 'Get Previous tag' |
17 | | - id: previoustag |
18 | | - uses: "WyriHaximus/github-action-get-previous-tag@master" |
19 | | - env: |
20 | | - GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" |
| 18 | + - name: 'Get Previous tag' |
| 19 | + id: previoustag |
| 20 | + uses: "WyriHaximus/github-action-get-previous-tag@master" |
| 21 | + env: |
| 22 | + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" |
21 | 23 |
|
22 | | - - name: calculate next version |
23 | | - id: version |
24 | | - uses: patrickjahns/version-drafter-action@v1 |
25 | | - env: |
26 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 24 | + - name: calculate next version |
| 25 | + id: version |
| 26 | + uses: patrickjahns/version-drafter-action@v1 |
| 27 | + env: |
| 28 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
27 | 29 |
|
28 | | - - name: Generate changelog |
29 | | - uses: charmixer/auto-changelog-action@8095796 |
30 | | - with: |
31 | | - token: ${{ secrets.GITHUB_TOKEN }} |
32 | | - future_release: ${{ steps.version.outputs.next-version }} |
| 30 | + - name: Generate changelog |
| 31 | + uses: charmixer/auto-changelog-action@v1.1 |
| 32 | + with: |
| 33 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 34 | + future_release: ${{ steps.version.outputs.next-version }} |
33 | 35 |
|
34 | | - - name: push changelog |
35 | | - uses: github-actions-x/commit@v2.6 |
36 | | - with: |
37 | | - github-token: ${{ secrets.GITHUB_TOKEN }} |
38 | | - push-branch: 'master' |
39 | | - commit-message: 'update changelog' |
40 | | - force-add: 'true' |
41 | | - files: CHANGELOG.md |
42 | | - name: T-Systems MMS |
43 | | - email: frage@t-systems-mms.com |
| 36 | + - name: push changelog |
| 37 | + uses: github-actions-x/commit@v2.6 |
| 38 | + with: |
| 39 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
| 40 | + push-branch: 'master' |
| 41 | + commit-message: 'update changelog' |
| 42 | + force-add: 'true' |
| 43 | + files: CHANGELOG.md |
| 44 | + name: T-Systems MMS |
| 45 | + email: frage@t-systems-mms.com |
44 | 46 |
|
45 | | - - name: Generate changelog for the release |
46 | | - uses: charmixer/auto-changelog-action@8095796 |
47 | | - with: |
48 | | - token: ${{ secrets.GITHUB_TOKEN }} |
49 | | - since_tag: ${{ steps.previoustag.outputs.tag }} |
50 | | - future_release: ${{ steps.version.outputs.next-version }} |
51 | | - output: CHANGELOGRELEASE.md |
| 47 | + # do a second checkout to prevent race situation |
| 48 | + # changelog gets updated but action works on old commit id |
| 49 | + - uses: actions/checkout@v2.3.4 |
| 50 | + with: |
| 51 | + ref: master |
52 | 52 |
|
53 | | - - name: Read CHANGELOG.md |
54 | | - id: package |
55 | | - uses: juliangruber/read-file-action@v1 |
56 | | - with: |
57 | | - path: ./CHANGELOGRELEASE.md |
| 53 | + - name: Generate changelog for the release |
| 54 | + run: | |
| 55 | + sed '/## \[${{ steps.previoustag.outputs.tag }}\]/Q' CHANGELOG.md > CHANGELOGRELEASE.md |
58 | 56 |
|
59 | | - - name: Create Release draft |
60 | | - id: create_release |
61 | | - uses: actions/create-release@v1 |
62 | | - env: |
63 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token |
64 | | - with: |
65 | | - release_name: ${{ steps.version.outputs.next-version }} |
66 | | - tag_name: ${{ steps.version.outputs.next-version }} |
67 | | - body: | |
68 | | - ${{ steps.package.outputs.content }} |
69 | | - draft: true |
| 57 | + - name: Read CHANGELOG.md |
| 58 | + id: package |
| 59 | + uses: juliangruber/read-file-action@v1 |
| 60 | + with: |
| 61 | + path: ./CHANGELOGRELEASE.md |
| 62 | + |
| 63 | + - name: Create Release draft |
| 64 | + id: create_release |
| 65 | + uses: actions/create-release@v1 |
| 66 | + env: |
| 67 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token |
| 68 | + with: |
| 69 | + release_name: ${{ steps.version.outputs.next-version }} |
| 70 | + tag_name: ${{ steps.version.outputs.next-version }} |
| 71 | + body: | |
| 72 | + ${{ steps.package.outputs.content }} |
| 73 | + draft: true |
0 commit comments