Automate release draft
This commit is contained in:
16
circle.yml
16
circle.yml
@@ -6,12 +6,18 @@ dependencies:
|
|||||||
- mv release/electron-mattermost-win32-ia32 release/electron-mattermost-win32
|
- mv release/electron-mattermost-win32-ia32 release/electron-mattermost-win32
|
||||||
- mv release/electron-mattermost-win32-x64 release/electron-mattermost-win64
|
- mv release/electron-mattermost-win32-x64 release/electron-mattermost-win64
|
||||||
- mv release/electron-mattermost-darwin-x64 release/electron-mattermost-osx
|
- mv release/electron-mattermost-darwin-x64 release/electron-mattermost-osx
|
||||||
- cd release && zip -9 -r /$CIRCLE_ARTIFACTS/electron-mattermost-win32.zip electron-mattermost-win32
|
- cd release && zip -9 -r $CIRCLE_ARTIFACTS/electron-mattermost-win32.zip electron-mattermost-win32
|
||||||
- cd release && zip -9 -r /$CIRCLE_ARTIFACTS/electron-mattermost-win64.zip electron-mattermost-win64
|
- cd release && zip -9 -r $CIRCLE_ARTIFACTS/electron-mattermost-win64.zip electron-mattermost-win64
|
||||||
- tar zcvf /$CIRCLE_ARTIFACTS/electron-mattermost-osx.tar.gz -C release electron-mattermost-osx
|
- tar zcvf $CIRCLE_ARTIFACTS/electron-mattermost-osx.tar.gz -C release electron-mattermost-osx
|
||||||
- tar zcvf /$CIRCLE_ARTIFACTS/electron-mattermost-linux-ia32.tar.gz -C release electron-mattermost-linux-ia32
|
- tar zcvf $CIRCLE_ARTIFACTS/electron-mattermost-linux-ia32.tar.gz -C release electron-mattermost-linux-ia32
|
||||||
- tar zcvf /$CIRCLE_ARTIFACTS/electron-mattermost-linux-x64.tar.gz -C release electron-mattermost-linux-x64
|
- tar zcvf $CIRCLE_ARTIFACTS/electron-mattermost-linux-x64.tar.gz -C release electron-mattermost-linux-x64
|
||||||
|
|
||||||
test:
|
test:
|
||||||
override:
|
override:
|
||||||
- exit 0
|
- exit 0
|
||||||
|
|
||||||
|
deployment:
|
||||||
|
release:
|
||||||
|
tag: /v[0-9]+(\.[0-9]+)*/
|
||||||
|
commands:
|
||||||
|
- ./circle/make_draft.sh
|
||||||
|
53
circle/make_draft.sh
Executable file
53
circle/make_draft.sh
Executable file
@@ -0,0 +1,53 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
set -ex
|
||||||
|
wget -q https://github.com/aktau/github-release/releases/download/v0.6.2/linux-amd64-github-release.tar.bz2
|
||||||
|
tar jxvf linux-amd64-github-release.tar.bz2
|
||||||
|
GITHUB_RELEASE=`pwd`/bin/linux/amd64/github-release
|
||||||
|
|
||||||
|
upload()
|
||||||
|
{
|
||||||
|
NAME=$1
|
||||||
|
FILE=$2
|
||||||
|
$GITHUB_RELEASE upload --user $CIRCLE_PROJECT_USERNAME --repo $CIRCLE_PROJECT_REPONAME --tag $CIRCLE_TAG --name \"$NAME\" --file $FILE
|
||||||
|
}
|
||||||
|
|
||||||
|
make_zip()
|
||||||
|
{
|
||||||
|
OLDDIR=`pwd`
|
||||||
|
ARCH=$1
|
||||||
|
cp -r release/electron-mattermost-$ARCH /tmp/electron-mattermost-$CIRCLE_TAG-$ARCH
|
||||||
|
cd /tmp
|
||||||
|
zip -9 -r electron-mattermost-$CIRCLE_TAG-$ARCH.zip electron-mattermost-$CIRCLE_TAG-$ARCH
|
||||||
|
cd $OLDDIR
|
||||||
|
}
|
||||||
|
|
||||||
|
make_tar_gz()
|
||||||
|
{
|
||||||
|
OLDDIR=`pwd`
|
||||||
|
ARCH=$1
|
||||||
|
cp -r release/electron-mattermost-$ARCH /tmp/electron-mattermost-$CIRCLE_TAG-$ARCH
|
||||||
|
cd /tmp
|
||||||
|
tar zcvf electron-mattermost-$CIRCLE_TAG-$ARCH.tar.gz electron-mattermost-$CIRCLE_TAG-$ARCH
|
||||||
|
cd $OLDDIR
|
||||||
|
}
|
||||||
|
|
||||||
|
deploy()
|
||||||
|
{
|
||||||
|
ARCH=$1
|
||||||
|
ARCHIVE_FORMAT=$2
|
||||||
|
case "$ARCHIVE_FORMAT" in
|
||||||
|
"zip" ) make_zip $ARCH ;;
|
||||||
|
"tar.gz" ) make_tar_gz $ARCH ;;
|
||||||
|
"*" ) echo "Invalid ARCHIVE_FORMAT: $ARCHIVE_FORMAT" && exit 1 ;;
|
||||||
|
esac
|
||||||
|
FILE=electron-mattermost-$CIRCLE_TAG-$ARCH.$ARCHIVE_FORMAT
|
||||||
|
upload "$FILE" /tmp/$FILE
|
||||||
|
}
|
||||||
|
|
||||||
|
$GITHUB_RELEASE release --user $CIRCLE_PROJECT_USERNAME --repo $CIRCLE_PROJECT_REPONAME --tag $CIRCLE_TAG --draft
|
||||||
|
|
||||||
|
deploy win32 zip
|
||||||
|
deploy win64 zip
|
||||||
|
deploy osx tar.gz
|
||||||
|
deploy linux-ia32 tar.gz
|
||||||
|
deploy linux-x64 tar.gz
|
@@ -3,7 +3,10 @@ MAINTAINER Yuya Ochiai <yuya0321@gmail.com>
|
|||||||
|
|
||||||
ENV NODE_VERSION=v4.2.3
|
ENV NODE_VERSION=v4.2.3
|
||||||
ENV PATH=$HOME/.nodebrew/current/bin:$PATH
|
ENV PATH=$HOME/.nodebrew/current/bin:$PATH
|
||||||
USER xclient
|
|
||||||
|
|
||||||
|
USER root
|
||||||
|
RUN apt-get update && apt-get -y install wget bzip2 zip
|
||||||
|
|
||||||
|
USER xclient
|
||||||
# install Node.js
|
# install Node.js
|
||||||
RUN curl -L git.io/nodebrew | perl - setup && nodebrew install-binary $NODE_VERSION && nodebrew use $NODE_VERSION
|
RUN curl -L git.io/nodebrew | perl - setup && nodebrew install-binary $NODE_VERSION && nodebrew use $NODE_VERSION
|
||||||
|
Reference in New Issue
Block a user