Skip to content

Commit bc2e5e8

Browse files
committed
ci: add release workflow
1 parent 3a8b391 commit bc2e5e8

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

.github/workflows/release.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Copyright (C) 2024 Sutou Kouhei <kou@clear-code.com>
2+
#
3+
# This library is free software; you can redistribute it and/or
4+
# modify it under the terms of the GNU Lesser General Public
5+
# License as published by the Free Software Foundation; either
6+
# version 2.1 of the License, or (at your option) any later version.
7+
#
8+
# This library is distributed in the hope that it will be useful,
9+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11+
# Lesser General Public License for more details.
12+
#
13+
# You should have received a copy of the GNU Lesser General Public
14+
# License along with this library; if not, write to the Free Software
15+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16+
17+
name: Release
18+
on:
19+
push:
20+
tags:
21+
- "*"
22+
jobs:
23+
github:
24+
name: GitHub
25+
runs-on: ubuntu-latest
26+
steps:
27+
- uses: actions/checkout@v4
28+
- name: Release
29+
run: |
30+
ruby \
31+
-e 'print("## "); puts(ARGF.read.split(/^## /)[1])' \
32+
doc/text/news.md > release-note.md
33+
title="$(head -n 1 release-note.md | sed -e 's/^## //')"
34+
tail -n +2 release-note.md > release-note-without-version.md
35+
gh release create \
36+
${GITHUB_REF_NAME} \
37+
--discussion-category Announcements \
38+
--notes-file release-note-without-version.md \
39+
--title "${title}"
40+
env:
41+
GH_TOKEN: ${{ github.token }}

0 commit comments

Comments
 (0)