-
Notifications
You must be signed in to change notification settings - Fork 14
125 lines (98 loc) · 4.61 KB
/
update-mariadb.yml
File metadata and controls
125 lines (98 loc) · 4.61 KB
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
name: Update MariaDB Version
on:
schedule:
# Check daily at 7:40am UTC
- cron: '40 7 * * *'
workflow_dispatch:
jobs:
check-update:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Check for new MariaDB 11.4 LTS release
id: check
run: |
# Get latest 11.4.x release from the MariaDB downloads REST API.
# No auth required; returns a stable JSON API.
LATEST=$(curl -fsSL --retry 3 --retry-delay 5 \
"https://downloads.mariadb.org/rest-api/mariadb/11.4/" | \
jq -r '[.releases | keys[] | select(test("^11\\.4\\."))] | sort_by(split(".") | map(tonumber)) | last')
if [ -z "$LATEST" ] || [ "$LATEST" = "null" ]; then
echo "::error::Failed to fetch latest MariaDB 11.4.x version from downloads.mariadb.org"
exit 1
fi
# Validate version format strictly
if ! [[ "$LATEST" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "::error::Invalid MariaDB version received: $LATEST"
exit 1
fi
# Get current version from melange.yaml
CURRENT=$(grep '^ version:' mariadb/melange.yaml | awk '{print $2}')
echo "Current version: $CURRENT"
echo "Latest version: $LATEST"
if [ "$LATEST" != "$CURRENT" ]; then
echo "update_available=true" >> $GITHUB_OUTPUT
echo "new_version=$LATEST" >> $GITHUB_OUTPUT
echo "current_version=$CURRENT" >> $GITHUB_OUTPUT
echo "Update available: $CURRENT -> $LATEST"
else
echo "update_available=false" >> $GITHUB_OUTPUT
echo "Already up to date"
fi
- name: Update version and checksum in all files
if: steps.check.outputs.update_available == 'true'
run: |
VERSION="${{ steps.check.outputs.new_version }}"
echo "Updating to MariaDB $VERSION"
# Download source tarball and compute SHA256 checksum
echo "Downloading MariaDB $VERSION tarball..."
curl -fsSL --retry 3 --retry-delay 5 \
"https://archive.mariadb.org/mariadb-${VERSION}/source/mariadb-${VERSION}.tar.gz" \
-o /tmp/mariadb.tar.gz
SHA256=$(sha256sum /tmp/mariadb.tar.gz | awk '{print $1}')
rm /tmp/mariadb.tar.gz
echo "SHA256: $SHA256"
# Update mariadb/melange.yaml - version
sed -i "s/^ version: .*/ version: $VERSION/" mariadb/melange.yaml
# Update mariadb/melange.yaml - checksum
sed -i "s/^ sha256: .*/ sha256: $SHA256/" mariadb/melange.yaml
# Reset epoch to 0 for new upstream version
sed -i "s/^ epoch: .*/ epoch: 0/" mariadb/melange.yaml
# Update Makefile
sed -i "s/MARIADB_VERSION ?= .*/MARIADB_VERSION ?= $VERSION/" Makefile
# Verify changes
echo "=== mariadb/melange.yaml ==="
grep -E '(version:|sha256:)' mariadb/melange.yaml | head -2
echo "=== Makefile ==="
grep 'MARIADB_VERSION' Makefile
- name: Create Pull Request
if: steps.check.outputs.update_available == 'true'
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
title: "chore(mariadb): bump to ${{ steps.check.outputs.new_version }}"
body: |
## Summary
Updates MariaDB from `${{ steps.check.outputs.current_version }}` to `${{ steps.check.outputs.new_version }}`.
## Changes
- `mariadb/melange.yaml` - package version, SHA256 checksum, epoch reset
- `Makefile` - MARIADB_VERSION variable
## Image Tag
Once merged, this will publish: `ghcr.io/rtvkiz/minimal-mariadb:${{ steps.check.outputs.new_version }}-r0`
## Links
- [MariaDB 11.4 Releases](https://mariadb.com/kb/en/release-notes-mariadb-11-4-series/)
- [MariaDB Downloads](https://mariadb.org/download/)
---
This PR was automatically created by the [update-mariadb](${{ github.server_url }}/${{ github.repository }}/actions/workflows/update-mariadb.yml) workflow.
branch: update-mariadb-${{ steps.check.outputs.new_version }}
commit-message: |
chore(mariadb): bump to ${{ steps.check.outputs.new_version }}
Updates MariaDB from ${{ steps.check.outputs.current_version }} to ${{ steps.check.outputs.new_version }}.
delete-branch: true
labels: |
dependencies
mariadb