Skip to content

MySQL 8.4.7 and Mroonga 15.22 #180

MySQL 8.4.7 and Mroonga 15.22

MySQL 8.4.7 and Mroonga 15.22 #180

Workflow file for this run

name: Build
on:
- push
- pull_request
concurrency:
group: ${{ github.head_ref || github.sha }}-${{ github.workflow }}
cancel-in-progress: true
jobs:
build:
name: ${{ matrix.id }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
id:
- "mysql-8.0"
- "mysql-8.4"
steps:
- name: Parse ID
run: |
set -x
if [ "${GITHUB_REF_TYPE}" = "tag" ] && [[ "${GITHUB_REF_NAME}" =~ ^${{ matrix.id }}\. ]]; then
version="${GITHUB_REF_NAME}"
else
version=${{ matrix.id }}-latest
fi
push=false
if [ "${GITHUB_EVENT_NAME}" = "push" ] && [ "${GITHUB_REPOSITORY}" = "mroonga/docker" ]; then
push=true
if [ "${GITHUB_REF_TYPE}" = "tag" ] && [ "${version}" != "${GITHUB_REF_NAME}" ]; then
push=false
fi
fi
tag="groonga/mroonga:${version}"
tags="${tag}"
if [ "${version}" = "mysql-8.0-latest" ]; then
tags="${tags},groonga/mroonga:latest"
fi
echo "PUSH=${push}" >> ${GITHUB_ENV}
echo "TAG=${tag}" >> ${GITHUB_ENV}
echo "TAGS=${tags}" >> ${GITHUB_ENV}
- uses: actions/checkout@v6
- uses: docker/login-action@v3
if: env.PUSH == 'true'
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- uses: docker/setup-buildx-action@v3
id: buildx
- uses: docker/build-push-action@v6
id: docker_build
with:
# cache-from: type=gha
# cache-to: type=gha,mode=max
context: ${{ matrix.id }}
push: ${{ env.PUSH }}
load: ${{ env.PUSH != 'true' }}
tags: ${{ env.TAGS }}
- name: Image info
run: |
dockerfile=${{ matrix.id }}/Dockerfile
mysql_version=$(grep -o 'mysql:[0-9.]*' ${dockerfile} | \
cut -d: -f2 | \
head -n1)
mroonga_version=$(grep -o 'mroonga_version=[0-9.]*' ${dockerfile} | \
cut -d= -f2 | \
head -n1)
groonga_version=$(grep -o 'groonga_version=[0-9.]*' ${dockerfile} | \
cut -d= -f2 | \
head -n1)
echo "MySQL ${mysql_version}, Mroonga ${mroonga_version}, Groonga ${groonga_version}" | tee release-title.txt
cat <<RELEASE_NOTE | tee release-note.md
* Commit: https://github.com/${GITHUB_REPOSITORY}/tree/${GITHUB_REF_NAME}
* Tags: ${TAGS}
* Digest: \`${{ steps.docker_build.outputs.digest }}\`
RELEASE_NOTE
- name: Create GitHub Release
if: github.ref_type == 'tag' && startsWith(github.ref_name, matrix.id)
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create "${GITHUB_REF_NAME}" \
--discussion-category Announcements \
--notes-file release-note.md \
--title "$(cat release-title.txt)"
- name: Test
run: |
./test.sh \
"${{ matrix.id }}" \
"${TAG}"