File tree 2 files changed +33
-4
lines changed
2 files changed +33
-4
lines changed Original file line number Diff line number Diff line change 5
5
vmImage : ' ubuntu-latest'
6
6
7
7
steps :
8
+ - task : DownloadSecureFile@1
9
+ inputs :
10
+ secureFile : vscode_typescript_next_deploy_key
11
+ displayName : ' Get the deploy key'
12
+
8
13
- script : |
9
14
set -e
15
+
10
16
chmod +x ./build/bumpAndPublish.sh
11
17
./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
12
38
displayName : ' Publish to marketplace'
Original file line number Diff line number Diff line change 2
2
npm run bump-version
3
3
result=$?
4
4
5
+ EXPECTED_ERROR_CODE=1
6
+ UNEXPECTED_ERROR_CODE=2
7
+
5
8
if [ $result -eq 0 ]; then
6
9
output=" $( npx vsce publish $f --pat $1 --noVerify 2>&1 ) "
7
10
publishResult=$?
@@ -10,15 +13,15 @@ if [ $result -eq 0 ]; then
10
13
exit
11
14
elif [[ $output =~ " already exists" ]]; then
12
15
echo " Publish failed but expected. Skipping publishing same version."
13
- exit
16
+ exit $EXPECTED_ERROR_CODE
14
17
else
15
18
echo " Error publishing"
16
- exit 1
19
+ exit $UNEXPECTED_ERROR_CODE
17
20
fi ;
18
21
elif [ $result -eq 1 ]; then
19
22
echo " Skipping publishing same version"
20
- exit
23
+ exit $EXPECTED_ERROR_CODE
21
24
else
22
25
echo " Error. Exited with $result "
23
- exit 1
26
+ exit $UNEXPECTED_ERROR_CODE
24
27
fi
You can’t perform that action at this time.
0 commit comments