Skip to content

Commit c84778a

Browse files
authored
Merge pull request #61 from sorenisanerd/dev
Merge dev branch
2 parents 26da8ec + 3749b07 commit c84778a

File tree

92 files changed

+1288
-434
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+1288
-434
lines changed

.github/workflows/build.yml

Lines changed: 41 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@ on:
55

66
jobs:
77
build:
8-
strategy:
9-
matrix:
10-
profiles:
11-
- verity-full,docker-ext
12-
- verity-full,docker
138
runs-on: ubuntu-latest
149
permissions:
1510
contents: write
@@ -78,26 +73,41 @@ jobs:
7873
cat <<EOF > mkosi.key
7974
$MANGOS_KEY
8075
EOF
76+
- name: Inject GnuPG key
77+
env:
78+
MANGOS_GNUPG_KEY: ${{ secrets.MANGOS_GNUPG_KEY }}
79+
run: |
80+
set -e
81+
if [ -z "${MANGOS_GNUPG_KEY}" ]; then
82+
echo '::warning title=Missing key::`MANGOS_GNUPG_KEY` was not set. Generating temporary key.'
83+
echo '`MANGOS_GNUPG_KEY` was not set. Build performed with ephemeral key.' >> ${GITHUB_STEP_SUMMARY}
84+
GNUPGHOME=$(pwd)/.gnupg gpg --batch --passphrase '' --quick-generate-key "ephemeral github.com/${GITHUB_REPOSITORY} signing Key"
85+
exit 0
86+
fi
87+
GNUPGHOME=$(pwd)/.gnupg gpg --batch --import <<EOF
88+
$MANGOS_GNUPG_KEY
89+
EOF
8190
- name: Download Hashistack
8291
run: |
8392
./hashiext-download.sh
8493
- name: Run mkosi
8594
env:
86-
profiles: ${{ matrix.profiles }}
8795
MANGOS_GITHUB_URL: ${{ github.server_url }}/${{ github.repository }}
8896
run: |
89-
mkosi -E RUNNER_ENVIRONMENT --debug --profile= --profile="${profiles},hashistack"
90-
mkosi -E RUNNER_ENVIRONMENT --debug --profile= --profile="${profiles},installer"
97+
mkosi -E RUNNER_ENVIRONMENT --debug
98+
rm *.zip mkosi.images/*/bin/*
9199
- name: List built artifacts
92-
run: find out/
100+
run: ls out/
93101
- name: Export image version for later steps
94102
run: echo IMAGE_VERSION="$(./mkosi.version)" >> $GITHUB_ENV
103+
- name: Free Disk Space (Ubuntu)
104+
uses: jlumbroso/free-disk-space@main
95105
- name: Test it
96106
run: |
97107
#!/bin/bash
98108
set -x
99109
set -e
100-
110+
sudo apt-get update -y
101111
# mkosi doesn't pick this up from the tools dir for some reason
102112
sudo apt-get install -y ovmf
103113
./run_tests.sh
@@ -110,7 +120,7 @@ jobs:
110120
shopt -s nullglob
111121
for file in out/mangos{,-installer}_${IMAGE_VERSION}.{raw,efi} out/docker*_${IMAGE_VERSION}.raw
112122
do
113-
zstd --rm "$file"
123+
test -f "${file}" && zstd --rm "$file"
114124
done
115125
# - name: Sign artifacts
116126
# run: for file in out/mangos* ; do cosign sign-blob -d -y --bundle "${file}.sigbundle" "${file}" > /dev/null; done
@@ -136,31 +146,27 @@ jobs:
136146
out/mangos-installer_${{ env.IMAGE_VERSION }}.github.json
137147
out/mangos-installer_${{ env.IMAGE_VERSION }}.spdx.json
138148
out/mangos-installer_${{ env.IMAGE_VERSION }}.syft.json
139-
name: mangos.${{ matrix.profiles }}
140-
141-
release:
142-
if: github.ref_type == 'tag'
143-
runs-on: ubuntu-latest
144-
needs:
145-
- build
146-
permissions:
147-
contents: write
148-
steps:
149-
- name: Download artifacts
150-
uses: actions/download-artifact@v4
151-
with:
152-
path: artifacts
153-
- name: Rename artifacts
154-
run: |
155-
mkdir release
156-
157-
mv artifacts/mangos.verity-full,docker-ext/* release/
158-
for f in artifacts/mangos.verity-full,docker/* ; do
159-
[ "$(basename $f)" == "mangosctl" ] && continue
160-
mv "$f" "release/mangos+docker_$(basename $f | cut -f2- -d_)"
161-
done
162149
- name: Release
150+
if: github.ref_type == 'tag'
163151
uses: softprops/action-gh-release@v2
164152
with:
165153
draft: true
166-
files: release/*
154+
files: |
155+
out/mangos_${{ env.IMAGE_VERSION }}.efi.zst
156+
out/mangos_${{ env.IMAGE_VERSION }}.root-x86-64.*.zst
157+
out/mangos_${{ env.IMAGE_VERSION }}.root-x86-64-verity.*.zst
158+
out/mangos_${{ env.IMAGE_VERSION }}.root-x86-64-verity-sig.*.zst
159+
out/mangos_${{ env.IMAGE_VERSION }}.raw.zst
160+
out/mangos_${{ env.IMAGE_VERSION }}.cyclonedx.json
161+
out/mangos_${{ env.IMAGE_VERSION }}.github.json
162+
out/mangos_${{ env.IMAGE_VERSION }}.spdx.json
163+
out/mangos_${{ env.IMAGE_VERSION }}.syft.json
164+
out/mangos_${{ env.IMAGE_VERSION }}.manifest
165+
out/mangosctl
166+
out/docker*_${{ env.IMAGE_VERSION }}.raw.zst
167+
out/mangos-installer_${{ env.IMAGE_VERSION }}.raw.zst
168+
out/mangos-installer_${{ env.IMAGE_VERSION }}.cyclonedx.json
169+
out/mangos-installer_${{ env.IMAGE_VERSION }}.github.json
170+
out/mangos-installer_${{ env.IMAGE_VERSION }}.spdx.json
171+
out/mangos-installer_${{ env.IMAGE_VERSION }}.syft.json
172+

.github/workflows/pr.yml

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@ on:
55

66
jobs:
77
build:
8-
strategy:
9-
matrix:
10-
profiles:
11-
- verity-full,docker-ext
12-
- verity-full,docker
138
runs-on: ubuntu-latest
149
steps:
1510
- name: Install cosign
@@ -56,20 +51,19 @@ jobs:
5651
dl/mangos.packages_*.tar.zst
5752
- name: Decompress and stage packages
5853
run: mkdir mkosi.packages ; tar -x --zstd -f dl/mangos.packages_*.tar.zst -C mkosi.packages
59-
- name: Generate key
54+
- name: Generate keys
6055
run: |
6156
#!/bin/sh
6257
mkosi genkey
58+
GNUPGHOME=$(pwd)/.gnupg gpg --batch --passphrase '' --quick-generate-key "test key"
6359
- name: Download Hashistack
6460
run: |
6561
./hashiext-download.sh
6662
- name: Run mkosi
6763
env:
68-
profiles: ${{ matrix.profiles }}
6964
MANGOS_GITHUB_URL: ${{ github.server_url }}/${{ github.repository }}
7065
run: |
71-
mkosi -E RUNNER_ENVIRONMENT --debug --profile= --profile="${profiles},hashistack"
72-
mkosi -E RUNNER_ENVIRONMENT --debug --profile= --profile="${profiles},installer"
66+
mkosi -E RUNNER_ENVIRONMENT --debug --profile= --profile=verity-full,docker-ext,hashistack
7367
- name: List built artifacts
7468
run: find out/
7569
- name: Export image version for later steps
@@ -79,7 +73,7 @@ jobs:
7973
#!/bin/bash
8074
set -x
8175
set -e
82-
76+
sudo apt-get update -y
8377
# mkosi doesn't pick this up from the tools dir for some reason
8478
sudo apt-get install -y ovmf
8579
./run_tests.sh
@@ -92,7 +86,7 @@ jobs:
9286
shopt -s nullglob
9387
for file in out/mangos{,-installer}_${IMAGE_VERSION}.{raw,efi} out/docker*_${IMAGE_VERSION}.raw
9488
do
95-
zstd --rm "$file"
89+
test -f "${file}" && zstd --rm "$file"
9690
done
9791
# - name: Sign artifacts
9892
# run: for file in out/mangos* ; do cosign sign-blob -d -y --bundle "${file}.sigbundle" "${file}" > /dev/null; done
@@ -118,4 +112,3 @@ jobs:
118112
out/mangos-installer_${{ env.IMAGE_VERSION }}.github.json
119113
out/mangos-installer_${{ env.IMAGE_VERSION }}.spdx.json
120114
out/mangos-installer_${{ env.IMAGE_VERSION }}.syft.json
121-
name: mangos.${{ matrix.profiles }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
/mkosi.packages
1010
/gpg
1111
/*.acast
12+
/.gnupg
13+
/dist
1214
/resources/cni/**
1315
mkosi.local
1416
mkosi.local.conf

0 commit comments

Comments
 (0)