chore: add bintray debian publishing script (#819)

This script can be used to publish Etcher debian packages to Bintray.

See: https://github.com/resin-io/etcher/issues/632
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
This commit is contained in:
Juan Cruz Viotti 2016-11-02 18:24:28 -04:00 committed by GitHub
parent e2652e6ee9
commit 8b47c3f017
3 changed files with 64 additions and 3 deletions

View File

@ -55,8 +55,24 @@ Run the following command:
> .\scripts\build\windows.bat all <x64|x86> > .\scripts\build\windows.bat all <x64|x86>
``` ```
Publishing Publishing to Bintray
---------- ---------------------
We publish GNU/Linux Debian packages to [Bintray][bintray].
Make sure you set the following environment variables:
- `BINTRAY_USER`
- `BINTRAY_API_KEY`
Run the following command:
```sh
./scripts/publish/bintray-debian.sh <debfile>
```
Publishing to S3
----------------
- [AWS CLI][aws-cli] - [AWS CLI][aws-cli]
@ -69,7 +85,7 @@ access Resin.io's production downloads S3 bucket.
Run the following command: Run the following command:
```sh ```sh
./scripts/publish.sh <file> ./scripts/publish/aws-s3.sh <file>
``` ```
Announcing Announcing
@ -80,3 +96,4 @@ new version of Etcher, and including the relevant section of the Changelog.
[aws-cli]: https://aws.amazon.com/cli [aws-cli]: https://aws.amazon.com/cli
[cygwin]: https://cygwin.com [cygwin]: https://cygwin.com
[bintray]: https://bintray.com

View File

@ -0,0 +1,44 @@
#!/bin/bash
set -e
if [ "$#" -ne 1 ]; then
echo "Usage: $0 <debfile>" 1>&2
exit 1
fi
if [ -z $BINTRAY_USER ] || [ -z $BINTRAY_API_KEY ]; then
echo "Please define the following environment variables:" 1>&2
echo "" 1>&2
echo " BINTRAY_USER" 1>&2
echo " BINTRAY_API_KEY" 1>&2
exit 1
fi
ARGV_FILE=$1
PACKAGE_COMPONENT=etcher
PACKAGE_DISTRIBUTION=stable
PACKAGE_FILE_NAME=$(basename $ARGV_FILE)
PACKAGE_NAME=${PACKAGE_FILE_NAME%.*}
PACKAGE_VERSION=$(echo $PACKAGE_NAME | cut -d_ -f2 | tr "~" "-")
PACKAGE_ARCH=$(echo $PACKAGE_NAME | cut -d_ -f3)
if [ -z $PACKAGE_VERSION ]; then
echo "Couldn't infer the version from the package file name" 1>&2
exit 1
fi
if [ -z $PACKAGE_ARCH ]; then
echo "Couldn't infer the architecture from the package file name" 1>&2
exit 1
fi
curl --upload-file $ARGV_FILE \
--user $BINTRAY_USER:$BINTRAY_API_KEY \
--header "X-Bintray-Debian-Distribution: $PACKAGE_DISTRIBUTION" \
--header "X-Bintray-Debian-Component: $PACKAGE_COMPONENT" \
--header "X-Bintray-Debian-Architecture: $PACKAGE_ARCH" \
--header "X-Bintray-Publish: 1" \
https://api.bintray.com/content/resin-io/debian/$PACKAGE_COMPONENT/$PACKAGE_VERSION/$PACKAGE_FILE_NAME
echo "$ARGV_FILE has been uploaded successfully"