Add publish script

This commit is contained in:
Pig Fang 2019-04-08 15:18:26 +08:00
parent c9f75f70d1
commit 7e70281fb2
2 changed files with 12 additions and 0 deletions

View File

@ -10,6 +10,7 @@ before_deploy:
- curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.15.2
- export PATH="$HOME/.yarn/bin:$PATH"
- RELEASE_TAG=$TRAVIS_TAG ./scripts/release.sh
- RELEASE_TAG=$TRAVIS_TAG ./scripts/publish.sh
deploy:
provider: releases

11
scripts/publish.sh Executable file
View File

@ -0,0 +1,11 @@
#!/bin/bash
set -e
mkdir dist
cd dist
cp ../blessing-skin-server-$RELEASE_TAG.zip blessing-skin-server-$RELEASE_TAG.zip
echo "{\"spec\":1,\"latest\":\"$RELEASE_TAG\",\"url\":\"\"}" > update.json
git init
git add .
git commit -m "Publish"
git remote add origin https://blessing-skin:$AZURE_TOKEN@dev.azure.com/blessing-skin/Blessing%20Skin%20Server/_git/Blessing%20Skin%20Server
git push -f origin master