-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: bakhtin <[email protected]>
- Loading branch information
Showing
1 changed file
with
26 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,11 @@ on: | |
env: | ||
ARTIFACTS_LIST: | # artifacts to upload, one per line | ||
cvm-image-azure-tdx.rootfs.wic | ||
ARTIFACTS_DIR: reproducible-build/artifacts | ||
BB_ENV_PASSTHROUGH_ADDITIONS: "DL_DIR SSTATE_DIR" | ||
BITBAKE_CACHE: "${HOME}/bitbake-cache" | ||
DL_DIR: "${BITBAKE_CACHE}/downloads" | ||
SSTATE_DIR: "${BITBAKE_CACHE}/sstate" | ||
|
||
jobs: | ||
release: | ||
|
@@ -19,22 +24,26 @@ jobs: | |
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Create cache dir | ||
run: | | ||
mkdir -p ${DL_DIR} ${SSTATE_DIR} | ||
- name: Restore cached build dependencies | ||
id: cache-build-restore | ||
uses: WarpBuilds/cache/restore@v1 | ||
with: | ||
path: build | ||
key: ${{ runner.os }}-yocto-manifests-build | ||
path: ${{ env.BITBAKE_CACHE }} | ||
key: ${{ runner.os }}-yocto-manifests | ||
|
||
- name: build | ||
- name: Build | ||
run: | | ||
make azure-image | ||
- name: Cache build dependencies | ||
id: cache-build-save | ||
uses: WarpBuilds/cache/save@v1 | ||
with: | ||
path: build | ||
path: ${{ env.BITBAKE_CACHE }} | ||
key: ${{ steps.cache-build-restore.outputs.cache-primary-key }} | ||
|
||
- name: Install rclone | ||
|
@@ -43,12 +52,17 @@ jobs: | |
sudo dpkg -i rclone.deb | ||
rm -f rclone.deb | ||
# - name: Create test artifact # TODO: remove | ||
# run: | | ||
# mkdir -p reproducible-build/artifacts | ||
# echo "test artifact" > ./reproducible-build/artifacts/cvm-image-azure-tdx.rootfs-20241002143710.wic | ||
# echo "test artifact 2" > ./reproducible-build/artifacts/cvm-image-azure-tdx.rootfs.wic.test | ||
# ln -rs ./reproducible-build/artifacts/cvm-image-azure-tdx.rootfs-20241002143710.wic ./reproducible-build/artifacts/cvm-image-azure-tdx.rootfs.wic | ||
- name: Resolve real paths of artifacts | ||
run: | | ||
REALPATH_ARTIFACTS_LIST=$(find ${ARTIFACTS_DIR} -maxdepth 1 -exec realpath {} \;) | ||
echo "REALPATH_ARTIFACTS_LIST=$REALPATH_ARTIFACTS_LIST" >> $GITHUB_ENV | ||
- name: Calculate hashsums of artifacts | ||
run: | | ||
cd ${ARTIFACTS_DIR} | ||
for artifact in $REALPATH_ARTIFACTS_LIST; do | ||
sha256sum $artifact > $artifact.sha256 | ||
done | ||
- name: Upload build artifacts | ||
env: | ||
|
@@ -72,8 +86,8 @@ jobs: | |
TODAY_DATE=$(date +"%Y/%m/%d") | ||
rclone copy -v --transfers=4 --s3-upload-concurrency=20 \ | ||
--contimeout=1m --retries 3 --retries-sleep 30s \ | ||
--fast-list --checksum --copy-links --files-from <(echo "$ARTIFACTS_LIST") \ | ||
reproducible-build/artifacts \ | ||
--fast-list --checksum --copy-links --files-from <(echo "$REALPATH_ARTIFACTS_LIST") \ | ||
${ARTIFACTS_DIR} \ | ||
r2:flashbots-public-artifacts/tdx-vm-images/$TODAY_DATE | ||
# Sync today's artifacts to latest | ||
|
@@ -92,6 +106,3 @@ jobs: | |
UPLOADED_ARTIFACTS_COUNT=$(echo "$UPLOADED_ARTIFACTS_STATS" | jq '.count') | ||
echo "✅ Successfully uploaded $UPLOADED_ARTIFACTS_COUNT artifacts (total size $UPLOADED_ARTIFACTS_SIZE):" | ||
echo "$ARTIFACTS_LIST" | ||
# - name: Setup ssh session | ||
# uses: Warpbuilds/[email protected] |