mirror of
https://github.com/bs-community/blessing-skin-server.git
synced 2024-12-21 06:19:38 +08:00
103 lines
2.9 KiB
YAML
103 lines
2.9 KiB
YAML
trigger:
|
|
- master
|
|
|
|
pool:
|
|
vmImage: 'ubuntu-latest'
|
|
|
|
variables:
|
|
RELEASE_TAG: '4.3.2'
|
|
|
|
steps:
|
|
- script: |
|
|
(git log -1 --pretty="%s" | grep -P 'Bump version to \d+\.\d+\.\d+') > /dev/null 2>&1
|
|
if [ $? -eq 0 ]
|
|
then
|
|
sudo update-alternatives --set php /usr/bin/php7.3
|
|
php -version
|
|
fi
|
|
displayName: 'Use PHP version 7.3'
|
|
|
|
- script: |
|
|
(git log -1 --pretty="%s" | grep -P 'Bump version to \d+\.\d+\.\d+') > /dev/null 2>&1
|
|
if [ $? -eq 0 ]
|
|
then
|
|
composer install --no-interaction --prefer-dist --no-dev
|
|
rm -rf vendor/bin
|
|
fi
|
|
displayName: 'composer install'
|
|
|
|
- task: NodeTool@0
|
|
inputs:
|
|
versionSpec: '10.x'
|
|
displayName: 'Install Node.js'
|
|
|
|
- script: |
|
|
(git log -1 --pretty="%s" | grep -P 'Bump version to \d+\.\d+\.\d+') > /dev/null 2>&1
|
|
if [ $? -eq 0 ]
|
|
then
|
|
yarn
|
|
yarn build
|
|
fi
|
|
displayName: 'Build front end'
|
|
|
|
- script: |
|
|
(git log -1 --pretty="%s" | grep -P 'Bump version to \d+\.\d+\.\d+') > /dev/null 2>&1
|
|
if [ $? -eq 0 ]
|
|
then
|
|
composer install --no-interaction --prefer-dist --no-dev
|
|
rm -rf vendor/bin
|
|
fi
|
|
displayName: 'Archive files'
|
|
|
|
- script: |
|
|
(git log -1 --pretty="%s" | grep -P 'Bump version to \d+\.\d+\.\d+') > /dev/null 2>&1
|
|
if [ $? -eq 0 ]
|
|
then
|
|
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 ..
|
|
fi
|
|
displayName: 'Create update source info'
|
|
|
|
- script: |
|
|
(cat resources/misc/changelogs/zh_CN/$RELEASE_TAG.md && cat resources/misc/changelogs/en/$RELEASE_TAG.md) > changelog.md
|
|
displayName: 'Generate changelog'
|
|
|
|
- task: GitHubRelease@0
|
|
displayName: 'Create GitHub Release'
|
|
inputs:
|
|
gitHubConnection: g-plane
|
|
repositoryName: '$(Build.Repository.Name)'
|
|
action: 'create'
|
|
target: '$(Build.SourceVersion)'
|
|
tagSource: 'auto'
|
|
releaseNotesSource: 'file'
|
|
releaseNotesFile: 'changelog.md'
|
|
assets: 'dist/blessing-skin-server-$(RELEASE_TAG).zip'
|
|
addChangeLog: false
|