Skip to content

Commit 3f62b91

Browse files
committed
ci release: add support for creating GitHub Releases automatically
1 parent c4a8f3b commit 3f62b91

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

.github/workflows/release.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "*"
7+
8+
jobs:
9+
github:
10+
name: GitHub
11+
runs-on: ubuntu-latest
12+
timeout-minutes: 10
13+
steps:
14+
- uses: actions/checkout@v3
15+
- name: Extract release note
16+
run: |
17+
ruby \
18+
-e 'print("## xmlrpc "); \
19+
puts(ARGF.read.split(/^## /)[1])' \
20+
NEWS.md > release-note.md
21+
- name: Upload to release
22+
run: |
23+
title=$(head -n1 release-note.md | sed -e 's/^## //')
24+
tail -n +2 release-note.md > release-note-without-version.md
25+
gh release create ${GITHUB_REF_NAME} \
26+
--discussion-category Announcements \
27+
--notes-file release-note-without-version.md \
28+
--title "${title}"
29+
env:
30+
GH_TOKEN: ${{ github.token }}

0 commit comments

Comments
 (0)