Skip to content

Build MariaDB

Build MariaDB #286

Workflow file for this run

name: "Build MariaDB"
on:
# pull_request:
push:
branches:
- "releases/*"
workflow_dispatch:
inputs:
mariadb-versions:
description: MariaDB 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 MariaDB versions
run: |
if [[ -z "$MARIADB_VERSIONS" ]]; then
MARIADB_VERSIONS=$(< versions/mariadb.json)
export MARIADB_VERSIONS
fi
{
echo "matrix-linux=$(printenv MARIADB_VERSIONS | jq -c '{mariadb: . , os: ["ubuntu-20.04", "ubuntu-22.04", "ubuntu-24.04"]}')"
echo "matrix-darwin=$(printenv MARIADB_VERSIONS | jq -c '{mariadb: .}')"
echo "matrix-windows=$(printenv MARIADB_VERSIONS | jq -c '{mariadb: .}')"
} >> "$GITHUB_OUTPUT"
env:
MARIADB_VERSIONS: ${{ github.event.inputs.mariadb-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:
MARIADB_VERSION: ${{ matrix.mariadb }}
BUILD_OS: ${{ matrix.os }}
timeout-minutes: 180
steps:
- uses: actions/checkout@v4
- run: .github/build-mariadb-linux.sh "$MARIADB_VERSION"
- name: upload
shell: bash
run: |
ACTIONS_VERSION=v$(< "$GITHUB_WORKSPACE/package.json" jq -r .version)
mv "$RUNNER_TEMP/mariadb.tar.zstd" "$RUNNER_TEMP/mariadb-$MARIADB_VERSION-$BUILD_OS-x64.tar.zstd"
gh release upload --clobber "$ACTIONS_VERSION" "$RUNNER_TEMP/mariadb-$MARIADB_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:
MARIADB_VERSION: ${{ matrix.mariadb }}
timeout-minutes: 180
steps:
- uses: actions/checkout@v4
- run: .github/build-mariadb-darwin.sh ${{ matrix.mariadb }}
- name: upload
shell: bash
run: |
ACTIONS_VERSION=v$(< "$GITHUB_WORKSPACE/package.json" jq -r .version)
mv "$RUNNER_TEMP/mariadb.tar.zstd" "$RUNNER_TEMP/mariadb-$MARIADB_VERSION-darwin-x64.tar.zstd"
gh release upload --clobber "$ACTIONS_VERSION" "$RUNNER_TEMP/mariadb-$MARIADB_VERSION-darwin-x64.tar.zstd"
env:
MARIADB_VERSION: ${{ matrix.mariadb }}
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:
MARIADB_VERSION: ${{ matrix.mariadb }}
timeout-minutes: 180
steps:
- uses: actions/checkout@v4
- run: .github/build-mariadb-darwin.sh ${{ matrix.mariadb }}
- name: upload
shell: bash
run: |
ACTIONS_VERSION=v$(< "$GITHUB_WORKSPACE/package.json" jq -r .version)
mv "$RUNNER_TEMP/mariadb.tar.zstd" "$RUNNER_TEMP/mariadb-$MARIADB_VERSION-darwin-arm64.tar.zstd"
gh release upload --clobber "$ACTIONS_VERSION" "$RUNNER_TEMP/mariadb-$MARIADB_VERSION-darwin-arm64.tar.zstd"
env:
MARIADB_VERSION: ${{ matrix.mariadb }}
GITHUB_TOKEN: ${{ github.token }}
- uses: actions/attest-build-provenance@v2
with:
subject-path: ${{ runner.temp }}/*.tar.zstd
build-windows:
runs-on: windows-2022
needs: list
strategy:
fail-fast: false
matrix: ${{fromJson(needs.list.outputs.matrix-windows)}}
env:
MARIADB_VERSION: ${{ matrix.mariadb }}
timeout-minutes: 180
steps:
- uses: actions/checkout@v4
- run: .github\build-mariadb-windows.ps1 $env:MARIADB_VERSION
- name: upload
shell: bash
run: |
ACTIONS_VERSION=v$(< "$GITHUB_WORKSPACE/package.json" jq -r .version)
TEMP_DIR=$(cygpath "C:\\Temp")
mv "$TEMP_DIR/mariadb.zip" "$TEMP_DIR/mariadb-$MARIADB_VERSION-win32-x64.zip"
gh release upload --clobber "$ACTIONS_VERSION" "$TEMP_DIR/mariadb-$MARIADB_VERSION-win32-x64.zip"
env:
MARIADB_VERSION: ${{ matrix.mariadb }}
GITHUB_TOKEN: ${{ github.token }}
- uses: actions/attest-build-provenance@v2
with:
subject-path: C:\Temp\*.zip