-
Notifications
You must be signed in to change notification settings - Fork 165
62 lines (55 loc) · 2.15 KB
/
release-body.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
name: Generate release body
on:
workflow_run:
workflows: ["Test drivers against a matrix of kernels/distros"]
types: [completed]
branches-ignore: ['master'] # ignore master runs (we could skip this given the below extract semver check; still, this is a small optimization)
permissions:
contents: write
concurrency:
group: "release-body"
cancel-in-progress: true
jobs:
release-body:
runs-on: ubuntu-latest
steps:
# Note: there is no `tag` filter for `workflow_run`.
# We need to manually check whether we are running on a tag.
- name: Extract semver ℹ️
uses: actions-ecosystem/action-regex-match@v2
id: regex-match
with:
text: ${{ github.event.workflow_run.head_branch }}
regex: '[0-9]+.[0-9]+.[0-9]+\+driver$'
- name: Skip on non driver tag
if: steps.regex-match.outputs.match == ''
run: exit 0
- name: Download matrixes
uses: dawidd6/action-download-artifact@v2
with:
workflow: kernel_tests.yaml
name: matrix_*
name_is_regexp: true
run_id: ${{ github.event.workflow_run.id }}
# Steps:
# Remove everything after the table (ie: since the first line that starts with "# ",
# ie: a markdown section start.
# Remove links to the markdown sections in the table too.
# Then, add a small title to each matrix
# Finally, merge them together
- name: Append matrixes to create release body
run: |
mv matrix_*/*.md .
sed -i -n '/# /q;p' matrix_X64.md
sed -i -n '/# /q;p' matrix_ARM64.md
sed -i 's/\[\(.\)\]([^)]*)/\1/g' matrix_X64.md
sed -i 's/\[\(.\)\]([^)]*)/\1/g' matrix_ARM64.md
sed -i '1s/^/# Driver Testing Matrix amd64\n\n/' matrix_X64.md
sed -i '1s/^/# Driver Testing Matrix arm64\n\n/' matrix_ARM64.md
cat matrix_X64.md matrix_ARM64.md > release-body.md
- name: Release
uses: softprops/action-gh-release@v1
with:
body_path: ./release-body.md
append_body: true
tag_name: ${{ github.event.workflow_run.head_branch }}