|
| 1 | +# Copyright (C) 2025 Sutou Kouhei <kou@clear-code.com> |
| 2 | +# |
| 3 | +# License: GPLv3+, GFDL and/or CC BY-SA 3.0 |
| 4 | +# |
| 5 | +# This program is free software: you can redistribute it and/or modify |
| 6 | +# it under the terms of the GNU General Public License as published by |
| 7 | +# the Free Software Foundation, either version 3 of the License, or |
| 8 | +# (at your option) any later version. |
| 9 | +# |
| 10 | +# This program is distributed in the hope that it will be useful, |
| 11 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | +# GNU General Public License for more details. |
| 14 | +# |
| 15 | +# You should have received a copy of the GNU General Public License |
| 16 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 17 | + |
| 18 | +name: Release |
| 19 | +on: |
| 20 | + push: |
| 21 | + tags: |
| 22 | + - "*" |
| 23 | +jobs: |
| 24 | + github: |
| 25 | + name: GitHub |
| 26 | + runs-on: ubuntu-latest |
| 27 | + timeout-minutes: 10 |
| 28 | + steps: |
| 29 | + - uses: actions/checkout@v4 |
| 30 | + - name: Release |
| 31 | + env: |
| 32 | + GH_TOKEN: ${{ github.token }} |
| 33 | + run: | |
| 34 | + ruby \ |
| 35 | + -e 'print("## "); puts(ARGF.read.split(/^## /)[1])' \ |
| 36 | + NEWS.md > release-note.md |
| 37 | + title="$(head -n 1 release-note.md | sed -e 's/^## //')" |
| 38 | + tail -n +2 release-note.md > release-note-without-version.md |
| 39 | + gh release create \ |
| 40 | + ${GITHUB_REF_NAME} \ |
| 41 | + --discussion-category Announcements \ |
| 42 | + --notes-file release-note-without-version.md \ |
| 43 | + --title "${title}" |
| 44 | +
|
| 45 | + rubygems: |
| 46 | + name: RubyGems |
| 47 | + runs-on: ubuntu-latest |
| 48 | + timeout-minutes: 10 |
| 49 | + permissions: |
| 50 | + id-token: write |
| 51 | + environment: release |
| 52 | + steps: |
| 53 | + - uses: actions/checkout@v5 |
| 54 | + - uses: ruby/setup-ruby@v1 |
| 55 | + with: |
| 56 | + ruby-version: ruby |
| 57 | + - name: Install dependencies |
| 58 | + run: | |
| 59 | + gem install rabbit |
| 60 | + - uses: rubygems/configure-rubygems-credentials@v1.0.0 |
| 61 | + - name: Push gems |
| 62 | + run: | |
| 63 | + rake publish:rubygems |
0 commit comments