Skip to content

Build MySQL

Build MySQL #362

Workflow file for this run

name: "Build MySQL"
on:
# pull_request:
push:
branches:
- "releases/*"
workflow_dispatch:
inputs:
mysql-versions:
description: MySQL versions to build (JSON Array)
required: false
default: ""
permissions:
contents: write
id-token: write
attestations: write
jobs:
list:
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- id: set-matrix
name: list available MySQL versions
run: |
if [[ -z "$MYSQL_VERSIONS" ]]; then
MYSQL_VERSIONS=$(< versions/mysql.json)
export MYSQL_VERSIONS
fi
{
echo "matrix-linux=$(printenv MYSQL_VERSIONS | jq -c '{mysql: . , os: ["ubuntu-20.04", "ubuntu-22.04", "ubuntu-24.04"]}')"
echo "matrix-darwin=$(printenv MYSQL_VERSIONS | jq -c '{mysql: .}')"
echo "matrix-windows=$(printenv MYSQL_VERSIONS | jq -c '{mysql: .}')"
} >> "$GITHUB_OUTPUT"
env:
MYSQL_VERSIONS: ${{ github.event.inputs.mysql-versions }}
outputs:
matrix-linux: ${{ steps.set-matrix.outputs.matrix-linux }}
matrix-darwin: ${{ steps.set-matrix.outputs.matrix-darwin }}
matrix-windows: ${{ steps.set-matrix.outputs.matrix-windows }}
build-linux:
runs-on: ${{ matrix.os }}
needs: list
strategy:
fail-fast: false
matrix: ${{fromJson(needs.list.outputs.matrix-linux)}}
env:
MYSQL_VERSION: ${{ matrix.mysql }}
BUILD_OS: ${{ matrix.os }}
timeout-minutes: 180
steps:
- uses: actions/checkout@v4
- run: .github/build-mysql-linux.sh "$MYSQL_VERSION"
- name: upload
shell: bash
run: |
ACTIONS_VERSION=v$(< "$GITHUB_WORKSPACE/package.json" jq -r .version)
mv "$RUNNER_TEMP/mysql.tar.zstd" "$RUNNER_TEMP/mysql-$MYSQL_VERSION-$BUILD_OS-x64.tar.zstd"
gh release upload --clobber "$ACTIONS_VERSION" "$RUNNER_TEMP/mysql-$MYSQL_VERSION-$BUILD_OS-x64.tar.zstd"
env:
GITHUB_TOKEN: ${{ github.token }}
- uses: actions/attest-build-provenance@v2
with:
subject-path: ${{ runner.temp }}/*.tar.zstd
build-darwin-x64:
runs-on: macos-13
needs: list
strategy:
fail-fast: false
matrix: ${{fromJson(needs.list.outputs.matrix-darwin)}}
env:
MYSQL_VERSION: ${{ matrix.mysql }}
timeout-minutes: 180
steps:
- uses: actions/checkout@v4
- run: |
# pre-installed version is too old.
# install new one.
brew install bison
- run: .github/build-mysql-darwin.sh "$MYSQL_VERSION"
- name: upload
shell: bash
run: |
ACTIONS_VERSION=v$(< "$GITHUB_WORKSPACE/package.json" jq -r .version)
mv "$RUNNER_TEMP/mysql.tar.zstd" "$RUNNER_TEMP/mysql-$MYSQL_VERSION-darwin-x64.tar.zstd"
gh release upload --clobber "$ACTIONS_VERSION" "$RUNNER_TEMP/mysql-$MYSQL_VERSION-darwin-x64.tar.zstd"
env:
GITHUB_TOKEN: ${{ github.token }}
- uses: actions/attest-build-provenance@v2
with:
subject-path: ${{ runner.temp }}/*.tar.zstd
build-darwin-arm64:
runs-on: macos-14
needs: list
strategy:
fail-fast: false
matrix: ${{fromJson(needs.list.outputs.matrix-darwin)}}
env:
MYSQL_VERSION: ${{ matrix.mysql }}
timeout-minutes: 180
steps:
- uses: actions/checkout@v4
- run: |
# pre-installed version is too old.
# install new one.
brew install bison
- run: .github/build-mysql-darwin-macos14.sh "$MYSQL_VERSION"
- name: upload
shell: bash
run: |
ACTIONS_VERSION=v$(< "$GITHUB_WORKSPACE/package.json" jq -r .version)
mv "$RUNNER_TEMP/mysql.tar.zstd" "$RUNNER_TEMP/mysql-$MYSQL_VERSION-darwin-arm64.tar.zstd"
gh release upload --clobber "$ACTIONS_VERSION" "$RUNNER_TEMP/mysql-$MYSQL_VERSION-darwin-arm64.tar.zstd"
env:
GITHUB_TOKEN: ${{ github.token }}
- uses: actions/attest-build-provenance@v2
with:
subject-path: ${{ runner.temp }}/*.tar.zstd
build-windows:
runs-on: ${{ startsWith(matrix.mysql, '5.') && 'windows-2019' || 'windows-2022' }}
needs: list
strategy:
fail-fast: false
matrix: ${{fromJson(needs.list.outputs.matrix-windows)}}
env:
MYSQL_VERSION: ${{ matrix.mysql }}
timeout-minutes: 180
steps:
- uses: actions/checkout@v4
- run: .github\build-mysql-windows.ps1 $env:MYSQL_VERSION
- name: upload
shell: bash
run: |
ACTIONS_VERSION=v$(< "$GITHUB_WORKSPACE/package.json" jq -r .version)
TEMP_DIR=$(cygpath "C:\\Temp")
mv "$TEMP_DIR/mysql.zip" "$TEMP_DIR/mysql-$MYSQL_VERSION-win32-x64.zip"
gh release upload --clobber "$ACTIONS_VERSION" "$TEMP_DIR/mysql-$MYSQL_VERSION-win32-x64.zip"
env:
GITHUB_TOKEN: ${{ github.token }}
- uses: actions/attest-build-provenance@v2
with:
subject-path: C:\Temp\*.zip