From 9eb6f1e334af6c8a91f6380f00c824fe2f2391fa Mon Sep 17 00:00:00 2001 From: valtzu Date: Thu, 18 Apr 2024 23:33:14 +0300 Subject: [PATCH] Update workflow --- .github/workflows/mkosi.yml | 38 +++++++++++++++++++++++-------------- Vagrantfile | 2 +- patch-uki-name.sh | 0 3 files changed, 25 insertions(+), 15 deletions(-) mode change 100644 => 100755 patch-uki-name.sh diff --git a/.github/workflows/mkosi.yml b/.github/workflows/mkosi.yml index 3b7de18..8890ea3 100644 --- a/.github/workflows/mkosi.yml +++ b/.github/workflows/mkosi.yml @@ -21,25 +21,35 @@ jobs: - run: | pipx ensurepath pipx install git+https://github.com/systemd/mkosi.git@v22 -# - name: Generate secure boot key -# run: mkosi --debug genkey - - name: Build (cached) tools - run: mkosi --preset=tools - - name: Show image summary - run: mkosi summary + - name: Setup mkosi + run: | + touch mkosi.key mkosi.crt + chmod 0600 mkosi.key mkosi.crt + cat << EOF > mkosi.key + ${{ secrets.MKOSI_KEY }} + EOF + cat << EOF > mkosi.crt + ${{ secrets.MKOSI_CRT }} + EOF + echo -n ${{ github.ref_name }} > mkosi.version + echo "OUTPUT_DIR=$(mkosi --json summary|jq -r '.Images[0]|.OutputDirectory')" >> $GITHUB_ENV + echo "OUTPUT=$(mkosi --json summary|jq -r '.Images[0]|.Output')" >> $GITHUB_ENV - name: Build images - run: mkosi --image-version=${{ github.ref_name }} - - name: Rename SHA256SUMS - run: mv mkosi.output/system_${{ github.ref_name }}.SHA256SUMS mkosi.output/SHA256SUMS + run: mkosi build + - name: Patch UKI name + run: ./patch-uki-name.sh ${{ env.OUTPUT_DIR }}/${{ env.OUTPUT }}.raw + - name: Compress outputs + run: xz -0 ${{ env.OUTPUT_DIR }}/${{ env.OUTPUT }}*.* + - name: Generate SHA256SUMS + working-directory: ${{ env.OUTPUT_DIR }} + run: sha256sum ${{ env.OUTPUT }}*.xz > SHA256SUMS - name: Release - uses: softprops/action-gh-release@v1 + uses: softprops/action-gh-release@v2 if: startsWith(github.ref, 'refs/tags/') with: draft: true fail_on_unmatched_files: true generate_release_notes: true files: | - mkosi.output/system_${{ github.ref_name }}.raw.xz - mkosi.output/system_${{ github.ref_name }}.usr-*.raw.xz - mkosi.output/system_${{ github.ref_name }}.efi - mkosi.output/SHA256SUMS + ${{ env.OUTPUT_DIR }}/${{ env.OUTPUT }}.* + ${{ env.OUTPUT_DIR }}/SHA256SUMS diff --git a/Vagrantfile b/Vagrantfile index 0862f44..75f54eb 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -10,7 +10,7 @@ Vagrant.configure("2") do |config| sudo apt-get update sudo apt-get install -y --no-install-recommends python3 python3-pip python-is-python3 python3-pyelftools python3-pefile pipx \ qemu-user-static binfmt-support bubblewrap dosfstools mtools uidmap libfdisk-dev libtss2-dev libssl-dev debian-archive-keyring \ - binutils-aarch64-linux-gnu + binutils-aarch64-linux-gnu jq sudo apt-get upgrade -y mkdir -p ~/build ~/.local/bin diff --git a/patch-uki-name.sh b/patch-uki-name.sh old mode 100644 new mode 100755