travisci: Upload macOS artifacts to S3 (#1290)

* travisci: Upload macOS artifacts to S3

* Test S3 upload without awscli upgrade
This commit is contained in:
Philipp Wolfer
2019-09-19 00:02:55 +02:00
committed by GitHub
parent ed944abbb9
commit 06fda4792d

View File

@@ -45,13 +45,19 @@ mv 'MusicBrainz Picard.tmp' 'MusicBrainz Picard.app'
dmg="MusicBrainz Picard $VERSION.dmg"
hdiutil create -volname "MusicBrainz Picard $VERSION" -srcfolder 'MusicBrainz Picard.app' -ov -format UDBZ "$dmg"
[ "$CODESIGN" = '1' ] && codesign --keychain $KEYCHAIN_PATH --verify --verbose --sign "$CERTIFICATE_NAME" "$dmg"
if [ -n "$UPLOAD_OSX" ]
then
set +e
md5 -r "$dmg"
if [ -n "$UPLOAD_OSX" ]; then
# make upload failures non fatal
curl -v --retry 6 --retry-delay 10 --max-time 180 --upload-file "$dmg" https://transfer.sh/
set +e
# Set $AWS_ARTIFACTS_BUCKET, $AWS_ACCESS_KEY_ID and $AWS_SECRET_ACCESS_KEY for AWS S3 upload to work
if [ -n "$AWS_ARTIFACTS_BUCKET" ] && [ -n "$AWS_ACCESS_KEY_ID" ]; then
# pip3 install --upgrade awscli
aws s3 cp --acl public-read "$dmg" "s3://${AWS_ARTIFACTS_BUCKET}/${TRAVIS_REPO_SLUG}/${TRAVIS_BUILD_NUMBER}/$dmg"
else
# Fall back to transfer.sh
curl -v --retry 6 --retry-delay 10 --max-time 180 --upload-file "$dmg" https://transfer.sh/
fi
set -e
# Required for a newline between the outputs
echo -e "\n"
md5 -r "$dmg"
fi