Skip to content

Add xz-utils

Add xz-utils #50

Workflow file for this run

name: 'Build mkosi image'
on:
workflow_dispatch:
push:
tags:
- '*'
permissions:
contents: write
jobs:
build-and-release:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
- run: |
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 debian-archive-keyring
- run: |
pipx ensurepath
pipx install git+https://github.com/systemd/mkosi.git@v22
- 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
echo "IMAGE_ID=$(mkosi --json summary|jq -r '.Images[0].ImageId')" >> $GITHUB_ENV
- name: Build images
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@v2
if: startsWith(github.ref, 'refs/tags/')
with:
draft: true
fail_on_unmatched_files: true
generate_release_notes: true
files: |
${{ env.OUTPUT_DIR }}/${{ env.OUTPUT }}*.raw.xz
${{ env.OUTPUT_DIR }}/${{ env.OUTPUT }}*.efi.xz
${{ env.OUTPUT_DIR }}/SHA256SUMS