-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (53 loc) · 1.92 KB
/
mkosi.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
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
- 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