generated from actions/typescript-action
-
-
Notifications
You must be signed in to change notification settings - Fork 8
144 lines (139 loc) · 4.95 KB
/
build-mariadb.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
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