Skip to content

Commit ac5d21a

Browse files
committed
FIx 3
Signed-off-by: bakhtin <[email protected]>
1 parent 3bdff0b commit ac5d21a

File tree

1 file changed

+48
-20
lines changed

1 file changed

+48
-20
lines changed

.github/workflows/release.yaml

Lines changed: 48 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,13 @@ on:
77
- tdx-rbuilder-ci
88
workflow_dispatch:
99

10+
env:
11+
ARTIFACTS_LIST: | # artifacts to upload, one per line
12+
cvm-image-azure-tdx.rootfs.wic
13+
1014
jobs:
1115
release:
12-
runs-on: warp-ubuntu-latest-x64-16x
16+
runs-on: warp-custom-ubuntu-2204-x64-32x-highdisk
1317

1418
steps:
1519
- name: Checkout code
@@ -22,27 +26,36 @@ jobs:
2226
path: build
2327
key: ${{ runner.os }}-yocto-manifests-build
2428

25-
# - name: build
26-
# run: |
27-
# make azure-image
29+
- name: build
30+
run: |
31+
make azure-image
32+
33+
- name: Cache build dependencies
34+
id: cache-build-save
35+
uses: WarpBuilds/cache/save@v1
36+
with:
37+
path: build
38+
key: ${{ steps.cache-build-restore.outputs.cache-primary-key }}
2839

2940
- name: Install rclone
3041
run: |
3142
curl -fsSL https://downloads.rclone.org/v1.68.1/rclone-v1.68.1-linux-amd64.deb -o rclone.deb
3243
sudo dpkg -i rclone.deb
3344
rm -f rclone.deb
3445
35-
- name: Create test artifact # TODO: remove
36-
run: |
37-
mkdir -p reproducible-build/artifacts
38-
echo "test artifact" > ./reproducible-build/artifacts/cvm-image-azure-tdx.rootfs-20241002143710.wic
39-
ln -s /artifacts/cvm-image-azure-tdx.rootfs-20241002143710.wic ./reproducible-build/artifacts/cvm-image-azure-tdx.rootfs.wic
46+
# - name: Create test artifact # TODO: remove
47+
# run: |
48+
# mkdir -p reproducible-build/artifacts
49+
# echo "test artifact" > ./reproducible-build/artifacts/cvm-image-azure-tdx.rootfs-20241002143710.wic
50+
# echo "test artifact 2" > ./reproducible-build/artifacts/cvm-image-azure-tdx.rootfs.wic.test
51+
# ln -rs ./reproducible-build/artifacts/cvm-image-azure-tdx.rootfs-20241002143710.wic ./reproducible-build/artifacts/cvm-image-azure-tdx.rootfs.wic
4052

4153
- name: Upload build artifacts
4254
env:
4355
AWS_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
4456
AWS_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
4557
run: |
58+
# Setup rclone
4659
mkdir -p ~/.config/rclone
4760
cat <<EOF > ~/.config/rclone/rclone.conf
4861
[r2]
@@ -55,15 +68,30 @@ jobs:
5568
no_check_bucket = true
5669
EOF
5770
58-
rclone copy -v --transfers=2 --s3-upload-concurrency=40 \
59-
--contimeout=10m --retries 10 --retries-sleep 60s --error-on-no-transfer \
60-
--fast-list --checksum --copy-links \
61-
/artifacts/cvm-image-azure-tdx.rootfs.wic \
62-
r2:flashbots-public-artifacts/images/cvm-image-azure-tdx.rootfs.wic
71+
# Upload artifacts
72+
TODAY_DATE=$(date +"%Y/%m/%d")
73+
rclone copy -v --transfers=4 --s3-upload-concurrency=20 \
74+
--contimeout=1m --retries 3 --retries-sleep 30s \
75+
--fast-list --checksum --copy-links --files-from <(echo "$ARTIFACTS_LIST") \
76+
reproducible-build/artifacts \
77+
r2:flashbots-public-artifacts/tdx-vm-images/$TODAY_DATE
6378
64-
- name: Cache build dependencies
65-
id: cache-build-save
66-
uses: WarpBuilds/cache/save@v1
67-
with:
68-
path: build
69-
key: ${{ steps.cache-build-restore.outputs.cache-primary-key }}
79+
# Sync today's artifacts to latest
80+
rclone sync -v --transfers=4 --contimeout=1m --retries 3 \
81+
--retries-sleep 30s --fast-list --checksum \
82+
r2:flashbots-public-artifacts/tdx-vm-images/$TODAY_DATE \
83+
r2:flashbots-public-artifacts/tdx-vm-images/latest
84+
85+
- name: Show upload stats
86+
env:
87+
AWS_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
88+
AWS_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
89+
run: |
90+
UPLOADED_ARTIFACTS_STATS=$(rclone size r2:flashbots-public-artifacts/tdx-vm-images/latest --json)
91+
UPLOADED_ARTIFACTS_SIZE=$(echo "$UPLOADED_ARTIFACTS_STATS" | jq '.bytes' | numfmt --to=iec)
92+
UPLOADED_ARTIFACTS_COUNT=$(echo "$UPLOADED_ARTIFACTS_STATS" | jq '.count')
93+
echo "✅ Successfully uploaded $UPLOADED_ARTIFACTS_COUNT artifacts (total size $UPLOADED_ARTIFACTS_SIZE):"
94+
echo "$ARTIFACTS_LIST"
95+
96+
# - name: Setup ssh session
97+
# uses: Warpbuilds/[email protected]

0 commit comments

Comments
 (0)