File tree Expand file tree Collapse file tree 2 files changed +33
-4
lines changed Expand file tree Collapse file tree 2 files changed +33
-4
lines changed Original file line number Diff line number Diff line change 55 vmImage : ' ubuntu-latest'
66
77steps :
8+ - task : DownloadSecureFile@1
9+ inputs :
10+ secureFile : vscode_typescript_next_deploy_key
11+ displayName : ' Get the deploy key'
12+
813- script : |
914 set -e
15+
1016 chmod +x ./build/bumpAndPublish.sh
1117 ./build/bumpAndPublish.sh "$(marketplace_key)"
18+ result=$?
19+
20+ if [ $result -eq 0 ]; then
21+ git config --local user.name "Azure Pipelines"
22+ git config --local user.email "[email protected] " 23+ git add .
24+ git commit -m "Publishing version bump ***NO_CI***"
25+
26+ mkdir ~/.ssh && mv $DOWNLOADSECUREFILE_SECUREFILEPATH ~/.ssh/id_rsa
27+ chmod 700 ~/.ssh && chmod 600 ~/.ssh/id_rsa
28+ ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts
29+ git remote set-url --push origin [email protected] :microsoft/vscode-typescript-next.git 30+ git push origin HEAD:master
31+
32+ exit
33+ elif [ $result -eq 1 ]; then
34+ exit
35+ else
36+ exit $result
37+ fi
1238 displayName : ' Publish to marketplace'
Original file line number Diff line number Diff line change 22npm run bump-version
33result=$?
44
5+ EXPECTED_ERROR_CODE=1
6+ UNEXPECTED_ERROR_CODE=2
7+
58if [ $result -eq 0 ]; then
69 output=" $( npx vsce publish $f --pat $1 --noVerify 2>&1 ) "
710 publishResult=$?
@@ -10,15 +13,15 @@ if [ $result -eq 0 ]; then
1013 exit
1114 elif [[ $output =~ " already exists" ]]; then
1215 echo " Publish failed but expected. Skipping publishing same version."
13- exit
16+ exit $EXPECTED_ERROR_CODE
1417 else
1518 echo " Error publishing"
16- exit 1
19+ exit $UNEXPECTED_ERROR_CODE
1720 fi ;
1821elif [ $result -eq 1 ]; then
1922 echo " Skipping publishing same version"
20- exit
23+ exit $EXPECTED_ERROR_CODE
2124else
2225 echo " Error. Exited with $result "
23- exit 1
26+ exit $UNEXPECTED_ERROR_CODE
2427fi
You can’t perform that action at this time.
0 commit comments