@@ -10,64 +10,63 @@ pool:
10
10
vmImage : ubuntu-16.04
11
11
12
12
steps :
13
- # release version should be correctly set in package.json
14
- - bash : |
15
- PACKAGE_VERSION=$(cat package.json | jq '.version')
16
- echo "PACKAGE_VERSION=$PACKAGE_VERSION"
17
- PUBLISHED_VERSION=$(curl 'https://marketplace.visualstudio.com/_apis/public/gallery/extensionquery' \
18
- -H 'origin: https://marketplace.visualstudio.com' \
19
- -H 'pragma: no-cache' \
20
- -H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.108 Safari/537.36' \
21
- -H 'content-type: application/json' \
22
- -H 'accept: application/json;api-version=5.1-preview.1;excludeUrls=true' \
23
- -H 'cache-control: no-cache' \-H 'authority: marketplace.visualstudio.com' \
24
- -H 'referer: https://marketplace.visualstudio.com/items?itemName=foxundermoon.shell-format' \
25
- --data-binary '{"assetTypes":null,"filters":[{"criteria":[{"filterType":7,"value":"foxundermoon.shell-format"}],"direction":2,"pageSize":1,"pageNumber":1,"sortBy":0,"sortOrder":0,"pagingToken":null}],"flags":71}' |
26
- jq '.results[0].extensions[0].versions[0].version')
27
- echo "PUBLISHED_VERSION=$PUBLISHED_VERSION"
28
- if [ "$PACKAGE_VERSION" = "$PUBLISHED_VERSION" ]; then
29
- echo 'niddend published'
30
- exit 1
31
- else
32
- echo "need publish"
33
- exit 0
34
- fi
35
- displayName : check need publish
36
- - bash : |
37
- PACKAGE_VERSION=$(node -p "require('./package.json').version")
38
- echo "##vso[build.updatebuildnumber]${PACKAGE_VERSION}_release_${BUILD_BUILDID}"
39
- echo "$PACKAGE_VERSION" > version.txt
40
- displayName : Set version number of build
13
+ # release version should be correctly set in package.json
14
+ - bash : |
15
+ PACKAGE_VERSION=$(cat package.json | jq '.version')
16
+ echo "PACKAGE_VERSION=$PACKAGE_VERSION"
17
+ PUBLISHED_VERSION=$(curl 'https://marketplace.visualstudio.com/_apis/public/gallery/extensionquery' \
18
+ -H 'origin: https://marketplace.visualstudio.com' \
19
+ -H 'pragma: no-cache' \
20
+ -H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.108 Safari/537.36' \
21
+ -H 'content-type: application/json' \
22
+ -H 'accept: application/json;api-version=5.1-preview.1;excludeUrls=true' \
23
+ -H 'cache-control: no-cache' \-H 'authority: marketplace.visualstudio.com' \
24
+ -H 'referer: https://marketplace.visualstudio.com/items?itemName=foxundermoon.shell-format' \
25
+ --data-binary '{"assetTypes":null,"filters":[{"criteria":[{"filterType":7,"value":"foxundermoon.shell-format"}],"direction":2,"pageSize":1,"pageNumber":1,"sortBy":0,"sortOrder":0,"pagingToken":null}],"flags":71}' |
26
+ jq '.results[0].extensions[0].versions[0].version')
27
+ echo "PUBLISHED_VERSION=$PUBLISHED_VERSION"
28
+ if [ "$PACKAGE_VERSION" = "$PUBLISHED_VERSION" ]; then
29
+ echo 'niddend published'
30
+ exit 1
31
+ else
32
+ echo "need publish"
33
+ exit 0
34
+ fi
35
+ displayName: check need publish
36
+ - bash : |
37
+ PACKAGE_VERSION=$(node -p "require('./package.json').version")
38
+ echo "##vso[build.updatebuildnumber]${PACKAGE_VERSION}_release_${BUILD_BUILDID}"
39
+ echo "$PACKAGE_VERSION" > version.txt
40
+ displayName: Set version number of build
41
41
42
- # do all the normal build stuff
43
- - template : common-steps.yml
42
+ # do all the normal build stuff
43
+ - template : common-steps.yml
44
44
45
- # if the mini changelog is empty, complain
46
- - bash : |
47
- LINE_COUNT=$(cat minichangelog.txt | wc -l)
48
- if [ "$LINE_COUNT" -lt 3 ]; then
49
- echo Mini changelog is too short. Did you use the wrong version number in CHANGELOG.txt?
50
- exit 1
51
- fi
52
- displayName : Check for length of mini-changelog
53
-
54
- # create a GitHub Release
55
- - bash : |
56
- export npm_config_cache=$(Build.SourcesDirectory)/.azure-pipelines/github-release/npm-cache
57
- npm install
58
- displayName : Prepare to create GitHub Release
59
- workingDirectory : ' $(Build.SourcesDirectory)/.azure-pipelines/github-release'
60
- - bash : |
61
- SCRIPT=.azure-pipelines/github-release/github-release.js
62
- VSIX=*.vsix
63
- VERSION=$(node -p "require('./package.json').version")
64
- node $SCRIPT $VSIX $VERSION $GITHUB_TOKEN
65
- displayName : Create GitHub Release
66
- env :
67
- GITHUB_TOKEN : $(github.token)
68
- - bash : |
69
- vsce publish -p $VS_MARKETPLACE_TOKEN
70
- displayName : publish to marketing
71
- env :
72
- VS_MARKETPLACE_TOKEN : $(vs.marketplace.token)
45
+ # if the mini changelog is empty, complain
46
+ - bash : |
47
+ LINE_COUNT=$(cat minichangelog.txt | wc -l)
48
+ if [ "$LINE_COUNT" -lt 3 ]; then
49
+ echo Mini changelog is too short. Did you use the wrong version number in CHANGELOG.txt?
50
+ exit 1
51
+ fi
52
+ displayName: Check for length of mini-changelog
73
53
54
+ # create a GitHub Release
55
+ - bash : |
56
+ export npm_config_cache=$(Build.SourcesDirectory)/.azure-pipelines/github-release/npm-cache
57
+ npm install
58
+ displayName: Prepare to create GitHub Release
59
+ workingDirectory: '$(Build.SourcesDirectory)/.azure-pipelines/github-release'
60
+ - bash : |
61
+ SCRIPT=.azure-pipelines/github-release/github-release.js
62
+ VSIX=*.vsix
63
+ VERSION=$(node -p "require('./package.json').version")
64
+ node $SCRIPT $VSIX $VERSION $GITHUB_TOKEN
65
+ displayName: Create GitHub Release
66
+ env:
67
+ GITHUB_TOKEN: $(github.token)
68
+ - bash : |
69
+ vsce publish -p $VS_MARKETPLACE_TOKEN
70
+ displayName: publish to marketing
71
+ env:
72
+ VS_MARKETPLACE_TOKEN: $(vs.marketplace.token)
0 commit comments