From ddd33eacccf4523ab5bddf0f639c06419d4cd8bf Mon Sep 17 00:00:00 2001 From: Nicholas Kuechler Date: Thu, 7 Nov 2024 12:12:01 -0600 Subject: [PATCH] feat: adds github workflow to create an ironic esp image --- .github/workflows/build-ironic-esp-image.yaml | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .github/workflows/build-ironic-esp-image.yaml diff --git a/.github/workflows/build-ironic-esp-image.yaml b/.github/workflows/build-ironic-esp-image.yaml new file mode 100644 index 000000000..01030c1fa --- /dev/null +++ b/.github/workflows/build-ironic-esp-image.yaml @@ -0,0 +1,49 @@ +--- +name: build-ironic-esp-image + +on: + workflow_dispatch: + pull_request: + paths: + - 'ironic-images/**' + push: + branches: + - main + paths: + - 'ironic-images/**' + merge_group: + types: [checks_requested] + +jobs: + + build: + runs-on: ubuntu-latest + + steps: + - name: Install Dependencies + run: sudo apt update && sudo apt install -y grub-efi-amd64-signed shim-signed mtools + + - name: Create esp image + run: | + cp /usr/lib/shim/shimx64.efi.signed /tmp/bootx64.efi + cp /usr/lib/grub/x86_64-efi-signed/grubnetx64.efi.signed /tmp/grubx64.efi + dd if=/dev/zero of=/tmp/esp.img bs=4096 count=1024 + mkfs.msdos -F 12 -n ESP_IMAGE /tmp/esp.img + mmd -i /tmp/esp.img EFI EFI/BOOT + mcopy -i /tmp/esp.img -v /tmp/bootx64.efi ::EFI/BOOT/BOOTX64.efi + mcopy -i /tmp/esp.img -v /tmp/grubx64.efi ::EFI/BOOT/GRUBX64.efi + mdir -i /tmp/esp.img ::EFI/BOOT + + - name: Set timestamp environment variable + run: echo "TIMESTAMP=$(git show --no-patch --no-notes --pretty='%cd' --date=format:'%Y%m%d%H%M%S' ${{ github.sha }})" >> $GITHUB_ENV + + - name: Publish Release + id: create_release + uses: softprops/action-gh-release@e7a8f85e1c67a31e6ed99a94b41bd0b71bbee6b8 # v2 + with: + name: understack-esp-images + tag_name: understack-esp-images-${{ env.TIMESTAMP }} + make_latest: true + fail_on_unmatched_files: true + files: /tmp/esp.img + if: ${{ github.ref == 'refs/heads/main' }}