From c06b285707b1733d3bcf4dabe67a8d388022a054 Mon Sep 17 00:00:00 2001 From: Jeremi Piotrowski Date: Mon, 30 Sep 2024 17:52:41 +0200 Subject: [PATCH] release.yaml: Split artifact upload and don't delete release Artifact upload is buffered in memory, which is a limitation of the action. We need to chunk the upload manually to work around this - by splitting it into groups that fit within the memory limit of the worker. We also don't need to delete the release - something that has caused us trouble when the action fails during upload - and instead update the payload of existing releases. We can either keep pushing the "latest" tag (like now) or push date base release tags and rename to "latest" manually. --- .github/workflows/release.yaml | 39 +++++++++++++++++++++++++--------- bake_flatcar_image.sh | 2 +- 2 files changed, 30 insertions(+), 11 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index ba674b6..f10594f 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -3,6 +3,7 @@ on: push: tags: - 'latest' + - '[0-9]+' jobs: build: runs-on: ubuntu-22.04 @@ -38,18 +39,36 @@ jobs: pushd bakery REPO=${{ github.repository }} ./release_build.sh - - name: delete previous latest release - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - pushd bakery - gh release delete latest --cleanup-tag - - - name: create a new latest release with all artifacts - uses: softprops/action-gh-release@v1 + - name: create a new latest release with some artifacts + uses: softprops/action-gh-release@v2 with: + make_latest: true body_path: bakery/Release.md files: | bakery/SHA256SUMS - bakery/*.raw + bakery/!(kubernetes|crio|ollama)*.raw bakery/*.conf + + - name: upload kubernetes x86-64 artifacts + uses: softprops/action-gh-release@v2 + with: + files: | + bakery/kubernetes*-x86-64.raw + + - name: upload kubernetes arm64 artifacts + uses: softprops/action-gh-release@v2 + with: + files: | + bakery/kubernetes*-arm64.raw + + - name: upload crio artifacts + uses: softprops/action-gh-release@v2 + with: + files: | + bakery/crio*.raw + + - name: upload ollama artifacts + uses: softprops/action-gh-release@v2 + with: + files: | + bakery/ollama*.raw diff --git a/bake_flatcar_image.sh b/bake_flatcar_image.sh index 0f88130..189a920 100755 --- a/bake_flatcar_image.sh +++ b/bake_flatcar_image.sh @@ -16,7 +16,7 @@ install_to="root:/opt/extensions/" set -euo pipefail workdir="$(pwd)/flatcar-os-image" -bakery_base_url="https://github.com/flatcar/sysext-bakery/releases/download/latest" +bakery_base_url="https://github.com/flatcar/sysext-bakery/releases/latest/download" # ./run_sdk_container ./image_to_vm.sh --help 2>&1 | grep '\--format' supported_vendors=( "ami" "ami_vmdk" "azure" "cloudsigma" "cloudstack" "cloudstack_vhd" "digitalocean" "exoscale" "gce" "hyperv" "iso" "openstack" "openstack_mini" "packet" "parallels" "pxe" "qemu" "qemu_uefi" "qemu_uefi_secure" "rackspace" "rackspace_onmetal" "rackspace_vhd" "vagrant" "vagrant_parallels" "vagrant_virtualbox" "vagrant_vmware_fusion" "virtualbox" "vmware" "vmware_insecure" "vmware_ova" "vmware_raw" "xen" )