implement `Upload Tagged Daily Release Bundle` step

This commit is contained in:
kifir 2024-06-27 19:06:34 +03:00 committed by rusefillc
parent 1ddaf0c496
commit ca8882d523
2 changed files with 21 additions and 1 deletions

View File

@ -510,3 +510,11 @@ runs:
github_token: ${{env.TOKEN}}
custom_tag: ${{ env.release_date }}
tag_prefix: ''
- name: Upload Tagged Daily Release Bundle
if: ${{ contains(inputs.uploads, 'bundles') && steps.checkTag.outputs.exists == 'false'}}
working-directory: ${{inputs.rusefi_dir}}/artifacts
shell: bash
run: |
: Upload Tagged Daily Release Bundle
bash ../firmware/bin/upload_bundle.sh ${{ env.RUSEFI_SSH_USER }} ${{ env.RUSEFI_SSH_PASS }} ${{ env.RUSEFI_SSH_SERVER }} ${{ env.BUNDLE_NAME }} ${{ env.release_date }}

View File

@ -4,6 +4,7 @@ USER=$1
PASS=$2
HOST=$3
BUNDLE_FILE_NAME=$4
RELEASE_TAG=$5
SCRIPT_NAME=$(basename "$0")
@ -23,6 +24,10 @@ if [ -n "${USER}" -a -n "$PASS" -a -n "${HOST}" ]; then
echo "$SCRIPT_NAME: bundle_upload_folder env variable was not specified using default ${bundle_upload_folder}"
fi
if [ -n "${RELEASE_TAG}" ]; then
echo "$SCRIPT_NAME: RELEASE_TAG is ${RELEASE_TAG}"
fi
# technical debt: more than one file uses magic 'rusefi_bundle_' constant, can we extract constant?
FULL_BUNDLE_FILE="rusefi_bundle_${BUNDLE_FILE_NAME}.zip"
UPDATE_BUNDLE_FILE="rusefi_bundle_${BUNDLE_FILE_NAME}_autoupdate.zip"
@ -33,12 +38,19 @@ mkdir ${bundle_upload_folder}
SSHCMD
RET=0
if [ "$AUTOMATION_LTS" == "true" -a -n "$AUTOMATION_REF" ]; then
if [ "$AUTOMATION_LTS" == "true" -a -n "$AUTOMATION_REF" ]; then # lts build
DESTINATION_FOLDER="${bundle_upload_folder}/lts/${AUTOMATION_REF}"
# sftp does not support -p flag on mkdir :(
sshpass -p $PASS sftp -o StrictHostKeyChecking=no ${USER}@${HOST} <<SSHCMD
mkdir ${bundle_upload_folder}/lts
mkdir ${DESTINATION_FOLDER}
SSHCMD
elif [ -n "${RELEASE_TAG}" ]; then # daily release with tag
DESTINATION_FOLDER="${bundle_upload_folder}/${SHORT_BOARD_NAME}/${RELEASE_TAG}"
# sftp does not support -p flag on mkdir :(
sshpass -p $PASS sftp -o StrictHostKeyChecking=no ${USER}@${HOST} <<SSHCMD
mkdir ${bundle_upload_folder}/${SHORT_BOARD_NAME}
mkdir ${DESTINATION_FOLDER}
SSHCMD
else
DESTINATION_FOLDER="${bundle_upload_folder}"