Skip to content

Commit 33260ab

Browse files
authored
Merge pull request #88 from nlbdev/feature/release-workflow-docx-markdown
Add Github workflow for releasing guidelines
2 parents 252e684 + ad6800d commit 33260ab

1 file changed

Lines changed: 60 additions & 0 deletions

File tree

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Release Guidelines
2+
3+
on:
4+
push:
5+
tags:
6+
- 'release-*'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
release:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Extract release notes from CHANGELOG
21+
id: release_notes
22+
run: |
23+
TAG="${GITHUB_REF_NAME}"
24+
VERSION="${TAG#release-}"
25+
26+
if [ -f "CHANGELOG.md" ]; then
27+
# Extract the section for this version (between two ## headings)
28+
awk -v ver="$VERSION" '
29+
/^## / {
30+
if (found) exit
31+
if (index($0, ver)) found=1; next
32+
}
33+
found { print }
34+
' CHANGELOG.md > release-body.md
35+
fi
36+
37+
# Fallback: if no content was extracted, use a placeholder
38+
if [ ! -s "release-body.md" ]; then
39+
echo "Release ${VERSION}" > release-body.md
40+
fi
41+
42+
- name: Setup Pandoc
43+
uses: pandoc/actions/setup@v1
44+
45+
- name: Build docx
46+
run: |
47+
pandoc "Nordic MathML Guidelines.md" \
48+
--from markdown \
49+
--to docx \
50+
--resource-path=. \
51+
-o "Nordic MathML Guidelines.docx"
52+
53+
- name: Create draft release
54+
uses: softprops/action-gh-release@v2
55+
with:
56+
draft: true
57+
body_path: release-body.md
58+
files: |
59+
Nordic MathML Guidelines.docx
60+
Nordic MathML Guidelines.md

0 commit comments

Comments
 (0)