forked from flatcar/sysext-bakery
-
Notifications
You must be signed in to change notification settings - Fork 0
94 lines (85 loc) · 3 KB
/
release.yaml
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
name: Build and release Systemd sysext images
on:
push:
tags:
- '*'
jobs:
build:
runs-on: ubuntu-22.04
permissions:
# allow the action to create a release
contents: write
steps:
# checkout the sources
- uses: actions/checkout@v3
# build the images and generate a manifest
- name: build
run: |
set -euxo pipefail
sudo apt update -qq && sudo apt install -yqq \
curl \
jq \
squashfs-tools \
xz-utils \
gawk
KBS_VERS=$(curl -fsSL --retry-delay 1 --retry 60 --retry-connrefused --retry-max-time 60 --connect-timeout 20 https://raw.githubusercontent.com/kubernetes/website/main/data/releases/schedule.yaml | yq -r '.schedules[].previousPatches[0].release' | awk '{print "kubernetes-v"$1}')
[[ -z "${KBS_VERS}" ]] && exit 1
KBS_VERS_ARRAY=(${KBS_VERS})
images=(
"docker-24.0.6"
"docker_compose-2.22.0"
"wasmtime-13.0.0"
)
images+=(${KBS_VERS_ARRAY[@]})
streams=()
for image in "${images[@]}"; do
component="${image%-*}"
version="${image#*-}"
for arch in x86-64 arm64; do
ARCH="${arch}" "./create_${component}_sysext.sh" "${version}" "${component}"
mv "${component}.raw" "${image}-${arch}.raw"
done
streams+=("${component}:-@v")
if [ "${component}" = "kubernetes" ]; then
streams+=("kubernetes-${version%.*}:.@v")
# Should give, e.g., v1.28 for v1.28.2 (use ${version#*.*.} to get 2)
fi
done
for stream in "${streams[@]}"; do
component="${stream%:*}"
pattern="${stream#*:}"
cat << EOF > "${component}.conf"
[Transfer]
Verify=false
[Source]
Type=url-file
Path=https://github.com/flatcar/sysext-bakery/releases/latest/download/
MatchPattern=${component}${pattern}-%a.raw
[Target]
InstancesMax=3
Type=regular-file
Path=/opt/extensions/${component%-*}
CurrentSymlink=/etc/extensions/${component%-*}.raw
EOF
done
cat << EOF > "noop.conf"
[Source]
Type=regular-file
Path=/
[Target]
Type=regular-file
Path=/
EOF
# Fetch the current SHA256SUMS to append to it the new list of sha256 sums.
curl -fsSLO https://github.com/flatcar/sysext-bakery/releases/download/latest/SHA256SUMS
sha256sum *.raw >> SHA256SUMS
sort --unique --key 2 --output SHA256SUMS SHA256SUMS
# create a Github release with the generated artifacts
- name: release
uses: softprops/action-gh-release@v1
with:
files: |
SHA256SUMS
*.raw
*.conf