2024-02-28 04:42:29 +01:00
|
|
|
#!/bin/bash
|
|
|
|
# This script is used to upload signed and notarized releases to S3 and update the Electron auto-update release feeds.
|
|
|
|
|
2024-03-05 07:03:53 +01:00
|
|
|
# Gets the directory of the script
|
2024-02-28 04:42:29 +01:00
|
|
|
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
|
|
|
|
|
|
|
BUILDS_DIR=$SCRIPT_DIR/builds
|
|
|
|
TEMP2_DIR=$SCRIPT_DIR/temp2
|
|
|
|
|
2024-03-05 07:03:53 +01:00
|
|
|
AUTOUPDATE_RELEASE_PATH="dl.waveterm.dev/releases"
|
2024-02-28 04:42:29 +01:00
|
|
|
|
|
|
|
# Copy the builds to the temp2 directory
|
|
|
|
echo "Copying builds to temp2"
|
|
|
|
rm -rf $TEMP2_DIR
|
|
|
|
mkdir -p $TEMP2_DIR
|
|
|
|
cp -r $BUILDS_DIR/* $TEMP2_DIR
|
|
|
|
|
|
|
|
UVERSION=$(cat $TEMP2_DIR/version.txt)
|
|
|
|
|
|
|
|
if [ -z "$UVERSION" ]; then
|
|
|
|
echo "version.txt is empty"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2024-03-05 07:03:53 +01:00
|
|
|
# Remove files we don't want to upload
|
|
|
|
rm $TEMP2_DIR/version.txt
|
|
|
|
rm $TEMP2_DIR/builder-*.yml
|
2024-02-28 04:42:29 +01:00
|
|
|
|
2024-03-05 07:03:53 +01:00
|
|
|
# Upload the artifacts
|
|
|
|
echo "Uploading build artifacts to $AUTOUPDATE_RELEASE_PATH"
|
|
|
|
aws s3 cp $TEMP2_DIR/ s3://$AUTOUPDATE_RELEASE_PATH/ --recursive
|
2024-02-28 04:42:29 +01:00
|
|
|
|
|
|
|
# Clean up
|
|
|
|
echo "Cleaning up"
|
|
|
|
rm -rf $TEMP2_DIR
|