Revert "Remove travis and old release script"

This reverts commit 1580d72590.
This commit is contained in:
Pig Fang 2019-07-05 19:40:36 +08:00
parent 94ef51ea0d
commit cd493b946f
2 changed files with 61 additions and 0 deletions

26
.travis.yml Normal file
View File

@ -0,0 +1,26 @@
language: php
php: 7.3
install: true
script: true
before_deploy:
- nvm install 10
- node -v
- 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
deploy:
provider: releases
api_key: $GITHUB_TOKEN
file: blessing-skin-server-$TRAVIS_TAG.zip
name: $TRAVIS_TAG
skip_cleanup: true
on:
tags: true
after_deploy:
- curl -s -o github-release.tar.bz2 -L https://github.com/aktau/github-release/releases/download/v0.7.2/linux-amd64-github-release.tar.bz2
- tar -xf github-release.tar.bz2
- ./bin/linux/amd64/github-release -v edit -u bs-community -r blessing-skin-server -t $TRAVIS_TAG -d "$(cat resources/misc/changelogs/en/$TRAVIS_TAG.md && echo -e '\n---\n' && cat resources/misc/changelogs/zh_CN/$TRAVIS_TAG.md)"

35
scripts/release.sh Executable file
View File

@ -0,0 +1,35 @@
#!/bin/bash
set -e
composer install --no-dev
rm -rf vendor/bin
yarn
yarn build
zip -9 -r blessing-skin-server-$RELEASE_TAG.zip \
app \
bootstrap \
config \
database \
plugins \
public \
resources/lang \
resources/views \
resources/misc \
routes \
storage \
vendor \
.env.example \
artisan \
LICENSE \
README.md \
README_EN.md
mkdir dist
cd dist
cp ../blessing-skin-server-$RELEASE_TAG.zip blessing-skin-server-$RELEASE_TAG.zip
echo "{\"spec\":2,\"php\":\"7.1.8\",\"latest\":\"$RELEASE_TAG\",\"url\":\"https://dev.azure.com/blessing-skin/51010f6d-9f99-40f1-a262-0a67f788df32/_apis/git/repositories/a9ff8df7-6dc3-4ff8-bb22-4871d3a43936/Items?path=%2Fblessing-skin-server-$RELEASE_TAG.zip\"}" > update_2.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
cd ..