Skip to content

Commit 8f43faa

Browse files
committed
WIP: Example for making files downloadable
Signed-off-by: Andy Doan <andy@foundries.io>
1 parent b9ed15b commit 8f43faa

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

.github/workflows/pull-request.yml

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ name: Compile test
33
on:
44
workflow_dispatch:
55

6+
env:
7+
persist_dir: /srv/gh-runners/quic-qrb-ros
8+
69
jobs:
710
build-pr:
811
strategy:
@@ -27,7 +30,6 @@ jobs:
2730
# echo "Downloading sdk"
2831
# .....
2932
# fi
30-
persist_dir=/srv/gh-runners/quic-qrb-ros
3133
3234
# quic-yocto uses Kas to build with:
3335
# export DL_DIR=${persist_dir}/downloads
@@ -37,3 +39,26 @@ jobs:
3739
# mkdir build
3840
# cd build
3941
# kas build ../ci/${{ matrix.machine }}.yml
42+
#
43+
- name: Publish artifacts
44+
run: |
45+
build_dir=${persist_dir}/builds/${GITHUB_RUN_ID}
46+
mkdir -p $build_dir
47+
48+
# TODO - copy files from the "Compile" step above
49+
# For now just make some fake files
50+
echo "This is persistent 1" > ${build_dir}/example1.txt
51+
echo "This is persistent 2" > ${build_dir}/example2.txt
52+
53+
# Instruct our file server to make these files available for download
54+
url="https://quic-qrt-ros-gh-runners-1029608027416.us-central1.run.app/${GITHUB_RUN_ID}/${{ matrix.machine }}/"
55+
56+
retries=3
57+
for ((i=0; i<retries; i++)); do
58+
curl -X POST -v ${url} && break
59+
echo "something went wrong, sleep and retry"
60+
sleep 2
61+
done
62+
(( retries == i )) && { echo 'Failed to publish artifacts'; exit 1; }
63+
64+
echo Artifacts available at: ${url}

0 commit comments

Comments
 (0)