Skip to content

Commit 6ec5bdc

Browse files
committed
Enhance build workflow
- Generate checksum file for release archives - Sign checksum file with Cosign - Fix source amalgamation by including sqlite3.h (which is used by the SQLite shell
1 parent cae4ffc commit 6ec5bdc

1 file changed

Lines changed: 57 additions & 0 deletions

File tree

.github/workflows/build-release.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,7 @@ jobs:
356356
sed -i 's/[[:space:]]*$//' "sqlite3mc_amalgamation.h"
357357
sed -i 's/[[:space:]]*$//' "shell3mc_amalgamation.c"
358358
cp ../src/sqlite3ext.h .
359+
cp ../src/sqlite3.h .
359360
ls -l
360361
361362
# -------------------------------------------------
@@ -1235,6 +1236,62 @@ jobs:
12351236
packaging/release-notes.md.in \
12361237
release/release-notes.md
12371238
1239+
# -------------------------------------------------
1240+
# Generate checksum file SHA256SUMS
1241+
# -------------------------------------------------
1242+
- name: Generate SHA256SUMS
1243+
working-directory: release
1244+
run: |
1245+
set -euo pipefail
1246+
checksum_file="sqlite3mc-${{ env.SQLITE3MC_VERSION }}-SHA256SUMS"
1247+
1248+
find . -maxdepth 1 -type f -name "sqlite3mc-*" \
1249+
! -name "*-SHA256SUMS*" \
1250+
! -name "*.sig" \
1251+
! -name "*.pem" \
1252+
-printf "%f\n" \
1253+
| sort \
1254+
| while read file; do
1255+
sha256sum "$file"
1256+
done > "$checksum_file"
1257+
1258+
echo "Created $checksum_file"
1259+
1260+
# -------------------------------------------------
1261+
# Install Cosign
1262+
# -------------------------------------------------
1263+
- name: Install Cosign
1264+
uses: sigstore/cosign-installer@v3
1265+
1266+
# -------------------------------------------------
1267+
# Sign SHA256SUMS with Cosign
1268+
# -------------------------------------------------
1269+
- name: Sign SHA256SUMS
1270+
working-directory: release
1271+
run: |
1272+
set -euo pipefail
1273+
checksum_file="sqlite3mc-${{ env.SQLITE3MC_VERSION }}-SHA256SUMS"
1274+
1275+
cosign sign-blob \
1276+
--yes \
1277+
--output-signature "${checksum_file}.sig" \
1278+
--output-certificate "${checksum_file}.pem" \
1279+
"$checksum_file"
1280+
1281+
# -------------------------------------------------
1282+
# Verify SHA256SUMS signature with Cosign
1283+
# -------------------------------------------------
1284+
- name: Verify SHA256SUMS signature
1285+
working-directory: release
1286+
run: |
1287+
set -euo pipefail
1288+
checksum_file="sqlite3mc-${{ env.SQLITE3MC_VERSION }}-SHA256SUMS"
1289+
1290+
cosign verify-blob \
1291+
--certificate "${checksum_file}.pem" \
1292+
--signature "${checksum_file}.sig" \
1293+
"$FILE"
1294+
12381295
# -------------------------------------------------
12391296
# Mode information
12401297
# -------------------------------------------------

0 commit comments

Comments
 (0)