Skip to content

Commit

Permalink
update var
Browse files Browse the repository at this point in the history
  • Loading branch information
wuwentao committed Jun 28, 2024
1 parent 2d8c33b commit 16b9027
Showing 1 changed file with 20 additions and 11 deletions.
31 changes: 20 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ jobs:
hw_model: ["canmv"]
outputs:
image_name: ${{ steps.save_image.outputs.image_name }}
image_path: ${{ steps.save_image.outputs.image_path }}
image_url: ${{ steps.save_image.outputs.image_url }}
image_md5: ${{ steps.save_tftp.outputs.image_md5 }}
image_path: ${{ steps.save_tftp.outputs.image_path }}
image_tftp: ${{ steps.save_tftp.outputs.image_tftp }}
steps:
- name: Build Env Setup
id: build_env
Expand Down Expand Up @@ -69,7 +71,6 @@ jobs:
- name: Checkout Code
id: checkout_code
run: |
set -x
PR_REPO=${{ github.event.pull_request.head.repo.full_name }}
PR_BRANCH=${{ github.event.pull_request.head.ref }}
BASE_REPO=${{ github.repository }}
Expand Down Expand Up @@ -135,16 +136,22 @@ jobs:
sudo cp -rf --sparse=always -L ${SRC_DIR}/${HW_TYPE}_${HW_MODEL}_*.img.gz ${DST_DIR}/${SUB_DIR}/
echo "${DST_DIR}/${SUB_DIR}/"
ls "${DST_DIR}/${SUB_DIR}/"
image_name=$(ls "${DST_DIR}/${SUB_DIR}/")
echo "image_name: $image_name"
echo "image_name=$image_name" >> $GITHUB_OUTPUT
echo "add latest link for current build"
test -h ${DST_DIR}/latest && sudo rm ${DST_DIR}/latest
sudo ln -s ${DST_DIR}/${ver} ${DST_DIR}/latest || exit 1
ls ${DST_DIR}/latest
echo "----------output URL----------"
echo "${DST_DIR}/${SUB_DIR}/" | sed "s/\/data1/https:\/\/ai\.b-bug\.org/g"
echo "----------save image done----------"
image_name=$(ls "${DST_DIR}/${SUB_DIR}/")
image_path="${DST_DIR}/${SUB_DIR}/"
image_url=$(echo "${DST_DIR}/${SUB_DIR}/" | sed "s/\/data1/https:\/\/ai\.b-bug\.org/g")
echo "image_name: $image_name"
echo "image_path: $image_path"
echo "image_url: $image_url"
echo "image_name=$image_name" >> $GITHUB_OUTPUT
echo "image_path=$image_path" >> $GITHUB_OUTPUT
echo "image_url=$image_url" >> $GITHUB_OUTPUT
- name: Save image to TFTP
id: save_tftp
Expand All @@ -166,11 +173,11 @@ jobs:
sudo mkdir -p ${DST_DIR}/${SUB_DIR}/ || exit 1;
sudo cp -rf --sparse=always -L ${SRC_DIR}/${HW_TYPE}_${HW_MODEL}_*.img.gz ${DST_DIR}/${SUB_DIR}
image_md5=$(md5sum ${DST_DIR}/${SUB_DIR}/${HW_TYPE}_${HW_MODEL}_*.img.gz | awk '{print $1}')
image_path="${DST_DIR}/${SUB_DIR}/"
image_tftp="${DST_DIR}/${SUB_DIR}/"
echo "image_md5: $image_md5"
echo "image_path: $image_path"
echo "image_tftp: $image_tftp"
echo "image_md5=$image_md5" >> $GITHUB_OUTPUT
echo "image_path=$image_path" >> $GITHUB_OUTPUT
echo "image_tftp=$image_tftp" >> $GITHUB_OUTPUT
test_image:
name: Test Image
Expand All @@ -193,14 +200,16 @@ jobs:
- name: Run Test
id: run_test
run: |
echo "image name: ${{needs.build_image.outputs.image_name}}"
echo "image path: ${{needs.build_image.outputs.image_path}}"
echo "image url: ${{needs.build_image.outputs.image_url}}"
echo "image md5: ${{needs.build_image.outputs.image_md5}}"
echo "image tftp path: ${{needs.build_image.outputs.image_tftp}}"
echo "=============================="
echo "There is NO test job NOW"
echo "=============================="
echo "add this stage for future job"
echo "=============================="
echo "image name: ${{needs.build_image.outputs.image_name}}"
echo "image md5: ${{needs.build_image.outputs.image_md5}}"
echo "image path: ${{needs.build_image.outputs.image_path}}"
whoami
uptime
pwd
Expand Down

0 comments on commit 16b9027

Please sign in to comment.