From 16b902712d086930eb3b03a18154264152c58549 Mon Sep 17 00:00:00 2001 From: Wentao Wu Date: Fri, 28 Jun 2024 11:06:13 +0800 Subject: [PATCH] update var --- .github/workflows/build.yml | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index eae4b5d..4783258 100755 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 @@ -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 }} @@ -135,9 +136,6 @@ 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 @@ -145,6 +143,15 @@ jobs: 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 @@ -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 @@ -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