Fix release-related issue
This commit is contained in:
parent
53069d53e3
commit
b28c8a8bf1
|
|
@ -5,78 +5,84 @@ pool:
|
|||
vmImage: 'ubuntu-latest'
|
||||
|
||||
variables:
|
||||
RELEASE_TAG: $(Build.SourceBranchName)
|
||||
RELEASE_TAG: '4.3.1'
|
||||
|
||||
steps:
|
||||
- script: |
|
||||
sudo update-alternatives --set php /usr/bin/php7.3
|
||||
php -version
|
||||
(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'
|
||||
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/')
|
||||
|
||||
- script: |
|
||||
composer install --no-interaction --prefer-dist --no-dev
|
||||
rm -rf vendor/bin
|
||||
(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'
|
||||
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/')
|
||||
|
||||
- task: NodeTool@0
|
||||
inputs:
|
||||
versionSpec: '10.x'
|
||||
displayName: 'Install Node.js'
|
||||
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/')
|
||||
|
||||
- script: |
|
||||
yarn
|
||||
yarn build
|
||||
(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'
|
||||
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/')
|
||||
|
||||
- script: |
|
||||
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
|
||||
cd ..
|
||||
(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'
|
||||
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/')
|
||||
|
||||
- script: |
|
||||
cd dist
|
||||
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 ..
|
||||
(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
|
||||
cd ..
|
||||
fi
|
||||
displayName: 'Create update source info'
|
||||
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/')
|
||||
|
||||
- script: |
|
||||
(cat resources/misc/changelogs/zh_CN/$RELEASE_TAG.md && echo "\n---\n" && cat resources/misc/changelogs/en/$RELEASE_TAG.md) > changelog.md
|
||||
displayName: 'Generate changelog'
|
||||
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/')
|
||||
|
||||
- task: GitHubRelease@0
|
||||
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/')
|
||||
displayName: 'Create GitHub Release'
|
||||
inputs:
|
||||
gitHubConnection: g-plane
|
||||
|
|
@ -86,5 +92,5 @@ steps:
|
|||
tagSource: 'auto'
|
||||
releaseNotesSource: 'file'
|
||||
releaseNotesFile: 'changelog.md'
|
||||
assets: 'dist/blessing-skin-server-$(Build.SourceBranchName).zip'
|
||||
assets: 'dist/blessing-skin-server-$(RELEASE_TAG).zip'
|
||||
addChangeLog: false
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ function git(args: readonly string[]) {
|
|||
}
|
||||
|
||||
(async () => {
|
||||
const files = ['./config/app.php', './package.json']
|
||||
const files = ['./config/app.php', './package.json', './azure-pipelines.yml']
|
||||
await Promise.all(files.map(saveVersion))
|
||||
await git(['add'].concat(files))
|
||||
await git(['commit', '-m', `Bump version to ${next}`])
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user