Merge pull request #33 from flatcar/kai/k8s-streams #15
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
images=( | |
"kubernetes-v1.28.2" | |
"docker-24.0.6" | |
"docker_compose-2.22.0" | |
"wasmtime-13.0.0" | |
) | |
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=/ | |
[email protected] | |
[Target] | |
Type=regular-file | |
Path=/ | |
EOF | |
sha256sum *.raw > SHA256SUMS | |
# create a Github release with the generated artifacts | |
- name: release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
SHA256SUMS | |
*.raw | |
*.conf |