-
Notifications
You must be signed in to change notification settings - Fork 0
97 lines (81 loc) · 3.04 KB
/
release-please.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
on:
push:
branches:
- main
# See: https://github.com/google-github-actions/release-please-action
name: release-please
permissions:
contents: write
pull-requests: write
jobs:
release-please:
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release.outputs.release_created }}
tag_name: ${{ steps.release.outputs.tag_name }}
steps:
- uses: GoogleCloudPlatform/release-please-action@v3
id: release
with:
# Change type and name depending on your repository
# See: https://github.com/google-github-actions/release-please-action#release-types-supported
release-type: rust
package-name: evident
pull-request-title-pattern: "chore: release${component} ${version}"
# Breaking changes might happen frequently before 1.0.0 => only bump minor
bump-minor-pre-major: true
changelog-types: >
[
{"type":"feat","section":"Features","hidden":false},
{"type":"fix","section":"Bug Fixes","hidden":false},
{"type":"arch","section":"Architectur/Refactor","hidden":false},
{"type":"chore","section":"Miscellaneous","hidden":true}
]
release-report:
runs-on: ubuntu-latest
container:
image: manuelhatzl/mantra:main
needs: release-please
outputs:
report: ${{ steps.report.outputs.report }}
env:
BRANCH_NAME: ${{ github.base_ref || github.ref_name }}
release_created: ${{ needs.release-please.outputs.release_created }}
tag_name: ${{ needs.release-please.outputs.tag_name }}
steps:
- uses: actions/checkout@v3
if: ${{ env.release_created }}
with:
repository: 'mhatzl/evident-wiki'
path: './req_folder'
sparse-checkout: 5-Requirements
- name: report
id: report
if: ${{ env.release_created }}
run: |
mantra release --branch=$BRANCH_NAME --release-tag=${{ env.tag_name }} --wiki-url-prefix=https://github.com/mhatzl/evident/wiki --report-file=release_report.md ./req_folder
content=$(cat release_report.md)
content="${content//\'/\\\'}"
content="${content//\"/\\\"}"
echo "report<<EOF" >> $GITHUB_OUTPUT
echo "$content" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
upload-report:
runs-on: ubuntu-latest
needs: ["release-report", "release-please"]
env:
release_created: ${{ needs.release-please.outputs.release_created }}
tag_name: ${{ needs.release-please.outputs.tag_name }}
report: ${{ needs.release-report.outputs.report }}
steps:
- uses: actions/checkout@v3
if: ${{ env.release_created }}
- name: upload
if: ${{ env.release_created }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
report="$(echo '${{ env.report }}')"
echo "$report" >> release_report.md
cat release_report.md
gh release upload ${{ env.tag_name }} release_report.md