Skip to content

Commit 992c16a

Browse files
committed
ci release: use GitHub Releases and Dicsussions
1 parent 183635a commit 992c16a

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

.github/workflows/release.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Release
2+
on:
3+
push:
4+
tags:
5+
- "*"
6+
jobs:
7+
github:
8+
name: GitHub
9+
runs-on: ubuntu-latest
10+
timeout-minutes: 10
11+
steps:
12+
- uses: actions/checkout@v3
13+
- name: Extract release note
14+
run: |
15+
ruby \
16+
-e 'print("## csv "); \
17+
puts(ARGF.read.split(/^## /)[1]. \
18+
gsub(/ {.+?}/, ""). \
19+
gsub(/\[(.+?)\]\[.+?\]/) {$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)