Skip to content

Commit 26182f6

Browse files
committed
ci: create GitHub Release on tagging
1 parent 2885211 commit 26182f6

File tree

1 file changed

+25
-3
lines changed

1 file changed

+25
-3
lines changed

.github/workflows/build.yml

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,31 @@ jobs:
6565
tags: ${{ steps.parse.outputs.tags }}
6666
- name: Image info
6767
run: |
68-
echo "ref: ${{ github.ref }}"
69-
echo "tags: ${{ steps.parse.outputs.tags }}"
70-
echo "digest: ${{ steps.docker_build.outputs.digest }}"
68+
dockerfile=${{ matrix.id }}/Dockerfile
69+
mysql_version=$(grep -o 'mysql:[0-9.]*' ${dockerfile} | \
70+
cut -d: -f2 | \
71+
head -n1)
72+
mroonga_version=$(grep -o 'groonga_version=[0-9.]*' ${dockerfile} | \
73+
cut -d: -f2 | \
74+
head -n1)
75+
groonga_version=$(grep -o 'groonga_version=[0-9.]*' ${dockerfile} | \
76+
cut -d: -f2 | \
77+
head -n1)
78+
echo "MySQL ${mysql_version}, Mroonga ${mroonga_version}, Groonga ${groonga_version}" | tee release-title.txt
79+
cat <<RELEASE_NOTE | tee release-note.md
80+
* Commit: https://github.com/${GITHUB_REPOSITORY}/tree/${GITHUB_REF_NAME}
81+
* Tags: ${{ steps.parse.outputs.tags }}
82+
* Digest: `${{ steps.docker_build.outputs.digest }}`
83+
RELEASE_NOTE
84+
- name: Create GitHub Release
85+
if: github.ref_type = 'tag'
86+
env:
87+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
88+
run: |
89+
gh create release "${GITHUB_REF_NAME}" \
90+
--discussion-category Announcements \
91+
--notes-file release-note.md \
92+
--title "$(cat release-title.txt)"
7193
- name: Test
7294
run: |
7395
./test.sh \

0 commit comments

Comments
 (0)