generated from actions/typescript-action
-
-
Notifications
You must be signed in to change notification settings - Fork 8
150 lines (144 loc) · 5 KB
/
build-mysql.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
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