build: only try to upload when there is a release

This commit is contained in:
D. Moonfire 2022-08-12 11:24:50 -05:00
parent 0700f86a9e
commit c129b5f86a

View file

@ -17,10 +17,13 @@ rm -f dmoonfire*
npx semantic-release
# Create a tarball of the output files and upload them to S3.
export npm_package_name=$(cat package.json | jq -r .name)
tar -cjf $npm_package_name.tar.bz2 dmoonfire*
s3cmd --access_key=$AWS_ACCESS_KEY_ID --access_token=$AWS_SECRET_ACCESS_KEY
--host=$AWS_ENDPOINT --host-bucket=$AWS_ENDPOINT -P put allegro.tar.bz2 s3://$AWS_BUCKET
if ls dmoonfire* &> /dev/null
then
export npm_package_name=$(cat package.json | jq -r .name)
tar -cjf $npm_package_name.tar.bz2 dmoonfire*
s3cmd --access_key=$AWS_ACCESS_KEY_ID --access_token=$AWS_SECRET_ACCESS_KEY --host=$AWS_ENDPOINT --host-bucket=$AWS_ENDPOINT -P put allegro.tar.bz2 s3://$AWS_BUCKET
fi
# Versions
# 2022-08-12 Added an if check for files before uploading
# 2022-08-11 - Initial version