github: Install rename for end to end tests #14
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 | |
on: | |
push: | |
tags: | |
- '*' | |
permissions: | |
contents: write | |
jobs: | |
image-build: | |
name: Image build | |
strategy: | |
fail-fast: false | |
runs-on: | |
- self-hosted | |
- cpu-4 | |
- mem-4G | |
- disk-100G | |
- arch-amd64 | |
- image-debian-12 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: | | |
sudo apt-get install --yes \ | |
debian-archive-keyring \ | |
make \ | |
pipx \ | |
qemu-utils \ | |
rename | |
- name: Setup Incus | |
run: | | |
curl https://pkgs.zabbly.com/get/incus-daily | sudo sh | |
sudo chmod 666 /var/lib/incus/unix.socket | |
incus admin init --auto | |
- name: Setup mkosi | |
run: | | |
pipx install git+https://github.com/systemd/mkosi.git | |
- name: Build the image | |
run: | | |
export PATH="${PATH}:/root/.local/bin" | |
( | |
cat << EOF | |
#!/bin/sh | |
echo ${{ github.ref_name }} | |
EOF | |
) > mkosi.version | |
echo "${{ secrets.SB_CERT }}" > mkosi.crt | |
chmod 644 mkosi.crt | |
echo "${{ secrets.SB_KEY }}" > mkosi.key | |
chmod 600 mkosi.key | |
make | |
- name: Prepare the files | |
run: | | |
mkdir upload | |
mv mkosi.output/debug.raw upload/ | |
mv mkosi.output/incus.raw upload/ | |
mv "$(ls mkosi.output/IncusOS_*.raw | grep -v usr | grep -v esp | sort | tail -1)" upload/ | |
mv "$(ls mkosi.output/IncusOS_*.efi | sort | tail -1)" upload/ | |
mv "$(ls mkosi.output/IncusOS_*.usr-x86-64.* | sort | tail -1)" upload/ | |
mv "$(ls mkosi.output/IncusOS_*.usr-x86-64-verity.* | sort | tail -1)" upload/ | |
mv "$(ls mkosi.output/IncusOS_*.usr-x86-64-verity-sig.* | sort | tail -1)" upload/ | |
cd upload | |
for i in *; do | |
gzip -9 "${i}" | |
done | |
rename \ | |
-E "s/usr-x86-64-verity-sig\..*/usr-x86-64-verity-sig.raw.gz/g" \ | |
-E "s/usr-x86-64-verity\..*/usr-x86-64-verity.raw.gz/g" \ | |
-E "s/usr-x86-64\..*/usr-x86-64.raw.gz/g" -- * | |
- name: Upload binaries to release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
file: upload/* | |
overwrite: true | |
file_glob: true | |
release_name: ${{ github.ref_name }} |