Skip to content

Commit

Permalink
ci release: create release page after uploading docuemnts or packages (
Browse files Browse the repository at this point in the history
…groonga#2156)

GitHub: groonga/packages.groonga.org#43

This PR introduces a part of new release workflow.
This release workflow handles the followings. We will implement it step
by step.

- Create release page. <- This PR is here.
- Download the uploaded artifacts.
- Upload the release artifacts to release page.
  • Loading branch information
otegami authored Dec 17, 2024
1 parent 86f26fe commit 06860d8
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 8 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/document.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,15 @@ jobs:
run: gh release upload ${{ github.ref_name }} document-*.tar.gz
env:
GH_TOKEN: ${{ github.token }}
release:
if: |
github.ref_type == 'tag'
needs: build
uses: ./.github/workflows/release.yml
with:
tag: ${{ github.ref_name }}
secrets:
token: ${{ secrets.GITHUB_TOKEN }}
# todo: Documents generated by Doxygen are also built with CMake.
doxygen:
name: Doxygen
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -309,3 +309,13 @@ jobs:
--volume ${PWD}:/groonga:ro \
${TEST_DOCKER_IMAGE} \
/groonga/packages/${TASK_NAMESPACE}/test.sh
release:
if: |
github.ref_type == 'tag'
needs: build
uses: ./.github/workflows/release.yml
with:
tag: ${{ github.ref_name }}
secrets:
token: ${{ secrets.GITHUB_TOKEN }}
24 changes: 16 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
name: Release
on:
push:
tags:
- '*'
workflow_call:
inputs:
tag:
required: true
type: string
secrets:
token:
required: true
jobs:
page:
name: Release Page
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Create release page
Expand All @@ -28,16 +35,17 @@ jobs:
echo "" >> release-note.md
echo "### Translations" >> release-note.md
echo "" >> release-note.md
version=${GITHUB_REF_NAME#v}
tag=${{ inputs.tag }}
version=${tag#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} \
gh release create "${tag}" \
--discussion-category Releases \
--notes-file release-note-without-version.md \
--title "${title}"
--title "${title}" || :
env:
GH_TOKEN: ${{ github.token }}

GH_TOKEN: ${{ secrets.token }}
# todo: donwload uploaded artifacts from caller workflow and upload them to release page.

0 comments on commit 06860d8

Please sign in to comment.