Skip to content

Commit 6ec2560

Browse files
committed
update release action
1 parent da57827 commit 6ec2560

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

.github/workflows/release.yml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,24 @@ jobs:
2424
- name: Extract changelog from appdata
2525
id: changelog
2626
run: |
27-
echo "changelog<<EOF" >> $GITHUB_OUTPUT
28-
xmlstarlet sel -t -m "/component/releases/release[@version='${{ steps.version.outputs.version }}']/description" -c . data/io.github.alainm23.planify.appdata.xml.in.in | sed 's/<[^>]*>//g' >> $GITHUB_OUTPUT
29-
echo "EOF" >> $GITHUB_OUTPUT
27+
python3 << 'PYTHON_SCRIPT' >> $GITHUB_OUTPUT
28+
import xml.etree.ElementTree as ET
29+
tree = ET.parse('data/io.github.alainm23.planify.appdata.xml.in.in')
30+
root = tree.getroot()
31+
version = '${{ steps.version.outputs.version }}'
32+
print('changelog<<EOF')
33+
desc = root.find('.//release[@version="' + version + '"]/description')
34+
if desc is not None:
35+
for elem in desc:
36+
if elem.tag == 'p' and elem.text:
37+
print(elem.text.strip())
38+
print()
39+
elif elem.tag == 'ul':
40+
for li in elem.findall('li'):
41+
print(f"- {li.text.strip()}")
42+
print()
43+
print('EOF')
44+
PYTHON_SCRIPT
3045
3146
- name: Create GitHub Release
3247
uses: softprops/action-gh-release@v2

0 commit comments

Comments
 (0)