-
Notifications
You must be signed in to change notification settings - Fork 6
85 lines (66 loc) · 2.03 KB
/
Copy pathrelease.yml
File metadata and controls
85 lines (66 loc) · 2.03 KB
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
name: Release
on:
release:
types:
- created
jobs:
set-body:
runs-on: ubuntu-latest
steps:
- run: sudo apt install pcregrep
- uses: actions/checkout@v4
- name: Parse changelog
id: parse-changelog
run: |
tag='${{ github.event.release.tag_name }}'
re_current_tag="## \[$tag\].*\n\n" # Match, but do not capture, current version tag, then...
re_changes_body='((.|\n)+?)' # capture everything including newlines...
re_previous_tag='## \[[0-9]+.[0-9]+.[0-9]+\]' # until previous version tag.
re_full="${re_current_tag}${re_changes_body}${re_previous_tag}"
echo 'match<<EOF' >> $GITHUB_OUTPUT
# Match multiple lines, output capture group 1.
pcregrep -M -o1 "$re_full" ./CHANGELOG.md >> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT
- name: Set release body
uses: softprops/action-gh-release@v2
with:
body: ${{ steps.parse-changelog.outputs.match }}
build:
uses: bessman/mcbootflash/.github/workflows/build.yml@main
attach-artifacts:
needs: build
runs-on: ubuntu-latest
steps:
- name: download
uses: actions/download-artifact@v4
# Artifacts are tar'd to preserve permissions.
- name: untar
run: |
tar -xf linux/mcbootflash.tar -C linux
tar -xf macos/mcbootflash.tar -C macos
tar -xf windows/mcbootflash.tar -C windows
- name: zip
run: |
zip -rj linux.zip linux/dist/*
zip -rj macos.zip macos/dist/*
zip -rj windows.zip windows/dist/*
- name: attach
uses: softprops/action-gh-release@v2
with:
files: |
linux.zip
macos.zip
windows.zip
pypi-publish:
runs-on: ubuntu-latest
environment: pypi
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
- name: build wheel and sdist
run: |
pip install flit
flit build
- name: publish
uses: pypa/gh-action-pypi-publish@release/v1