forked from groonga/groonga
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci deploy: release add deploy workflow to notify successful package u…
…pload GitHub: groonga/packages.groonga.org#43 This PR introduces a new release workflow. This release workflow handdle the followings. We will implement it step by step. - Create release page <- This PR is here. - Upload the release artifacts to release page
- Loading branch information
Showing
3 changed files
with
64 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,54 @@ | ||
name: Release | ||
on: | ||
push: | ||
tags: | ||
- '*' | ||
workflow_call: | ||
inputs: | ||
tag: | ||
required: true | ||
type: string | ||
secrets: | ||
token: | ||
required: true | ||
jobs: | ||
page: | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Create release page | ||
run: | | ||
(cd doc/source/news && \ | ||
ruby \ | ||
-e 'print("## Groonga "); \ | ||
puts(ARGF.read.split(/^## Release /)[1]. \ | ||
gsub(/^\(.+\)=$/, ""). \ | ||
gsub(/{doc}`(.+?)`/) { \ | ||
id = $1; \ | ||
title = id.split("\/").last; \ | ||
path = id.delete_prefix("/"); \ | ||
url = "https://groonga.org/docs/#{path}.html"; \ | ||
"[#{title}](#{url})"; \ | ||
}. \ | ||
gsub(/{ref}`(.+?)`/) {$1}. | ||
strip)' \ | ||
$(ls *.md | sort --human-numeric-sort | tail -n1)) > \ | ||
release-note.md | ||
echo "" >> release-note.md | ||
echo "### Translations" >> release-note.md | ||
echo "" >> release-note.md | ||
version=${GITHUB_REF_NAME#v} | ||
major_version=${version%%.*} | ||
version_hyphen=$(echo ${version} | tr . -) | ||
echo " * [Japanese](https://groonga.org/ja/docs/news/${major_version}.html#release-${version_hyphen})" >> release-note.md | ||
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 Releases \ | ||
--notes-file release-note-without-version.md \ | ||
--title "${title}" | ||
if gh release view "${{ inputs.tag }}" > /dev/null 2>&1; then | ||
echo "Skip the creation step for Release ${{ inputs.tag }}." | ||
else | ||
gh release create "${{ inputs.tag }}" \ | ||
--title "release-${{ inputs.tag }}" | ||
(cd doc/source/news && \ | ||
ruby \ | ||
-e 'print("## Groonga "); \ | ||
puts(ARGF.read.split(/^## Release /)[1]. \ | ||
gsub(/^\(.+\)=$/, ""). \ | ||
gsub(/{doc}`(.+?)`/) { \ | ||
id = $1; \ | ||
title = id.split("\/").last; \ | ||
path = id.delete_prefix("/"); \ | ||
url = "https://groonga.org/docs/#{path}.html"; \ | ||
"[#{title}](#{url})"; \ | ||
}. \ | ||
gsub(/{ref}`(.+?)`/) {$1}. | ||
strip)' \ | ||
$(ls *.md | sort --human-numeric-sort | tail -n1)) > \ | ||
release-note.md | ||
echo "" >> release-note.md | ||
echo "### Translations" >> release-note.md | ||
echo "" >> release-note.md | ||
version=${{ inputs.tag#v }} | ||
major_version=${version%%.*}inputs.tag | ||
version_hyphen=$(echo ${version} | tr . -) | ||
echo " * [Japanese](https://groonga.org/ja/docs/news/${major_version}.html#release-${version_hyphen})" >> release-note.md | ||
title="$(head -n1 release-note.md | sed -e 's/^## //')" | ||
tail -n +2 release-note.md > release-note-without-version.md | ||
gh release create ${{ inputs.tag }} \ | ||
z--discussion-category Releases \ | ||
--notes-file release-note-without-version.md \ | ||
--title "${title}" | ||
fi | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
|
||
GH_TOKEN: ${{ secrets.token } | ||
# todo: donwload uploaded artifacts from caller workflow and upload them to release page. |