From 094f43e0baa4601f432a86f6ff4a28761e8b8678 Mon Sep 17 00:00:00 2001 From: Abe Tomoaki Date: Thu, 16 May 2024 08:29:11 +0900 Subject: [PATCH] ci: Add release job (#142) --- .github/workflows/release.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..344145df --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,29 @@ +name: Release +on: + push: + tags: + - "*" +jobs: + github: + name: GitHub + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Extract release note + run: | + ruby \ + -e 'print("## Full text search plugin "); \ + puts(ARGF.read.split(/^## /)[1]. \ + gsub(/ {.+?}/, ""). \ + gsub(/\[(.+?)\]\[.+?\]/) {$1})' \ + NEWS.md > release-note.md + - name: Upload to release + run: | + title=$(head -n1 release-note.md | sed -e 's/^## //') + tail -n +2 release-note.md > release-note-without-version.md + gh release create ${GITHUB_REF_NAME} \ + --discussion-category Announcements \ + --notes-file release-note-without-version.md \ + --title "${title}" + env: + GH_TOKEN: ${{ github.token }}