@@ -24,17 +24,16 @@ jobs:
2424
2525 steps :
2626 - uses : actions/checkout@v2
27-
28- - name : Unshallow
29- run : git fetch --prune --unshallow
30-
27+ with :
28+ fetch-depth : 0
29+
3130 - uses : actions/cache@v2
3231 with :
3332 path : ~/.nuget/packages
3433 key : ${{ runner.os }}-nuget-${{ hashFiles('**/packages.config') }}
3534 restore-keys : |
3635 ${{ runner.os }}-nuget-
37-
36+
3837 - uses : microsoft/variable-substitution@v1
3938 with :
4039 files : ' .\Snyk.Common\appsettings.json'
@@ -55,54 +54,80 @@ jobs:
5554 - name : Restore NuGet packages
5655 run : nuget restore ${{env.SOLUTION_FILE_PATH}}
5756
58- - name : Increment VSIX version
57+ - name : Calculate next semantic version Git tag (vsix version)
5958 id : vsix_version
60- uses : timheuer/vsix-version-stamp@v1
59+ uses : ./.github/actions/next-git-tag -Verbose
60+
61+ - name : Set VSIX version for 2015-2019
62+ uses : cezarypiatek/VsixVersionAction@1.0
6163 with :
62- manifest-file : ${{ env.VsixManifestPath }}
63-
64- - name : Set up Git actions user
65- uses : fregante/setup-git-user@v1
66-
67- - name : Commit new version
68- run : |
69- git commit -am 'increment new version'
70- git tag ${{ steps.vsix_version.outputs.version-number }}
71- git push origin main
72- git push origin main --tags
73-
64+ version : ${{ steps.vsix_version.outputs.next-tag }}
65+ vsix-manifest-file : .\Snyk.VisualStudio.Extension\source.extension.vsixmanifest
66+
67+ - name : Set VSIX version for 2022
68+ uses : cezarypiatek/VsixVersionAction@1.0
69+ with :
70+ version : ${{ steps.vsix_version.outputs.next-tag }}
71+ vsix-manifest-file : .\Snyk.VisualStudio.Extension.2022\source.extension.vsixmanifest
72+
7473 - name : Build
7574 run : |
7675 msbuild ${{env.SOLUTION_FILE_PATH}} /p:configuration=Release /p:DeployExtension=false /p:ZipPackageCompressionLevel=normal /v:m
7776 shell : powershell
7877
7978 - name : Tests
8079 run : vstest.console.exe **\*.Tests.dll
81-
82- - name : Create Release
80+
81+ - name : Set up Git actions user
82+ uses : fregante/setup-git-user@v1
83+
84+ - name : Create and push Git tag release
85+ run : |
86+ git tag ${{ steps.vsix_version.outputs.next-tag }}
87+ git push origin main
88+ git push origin main --tags
89+
90+ - name : Create GitHub Release
8391 id : create_release
8492 uses : actions/create-release@v1
8593 env :
8694 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
8795 with :
88- tag_name : ${{ steps.vsix_version.outputs.version-number }}
89- release_name : Release ${{ steps.vsix_version.outputs.version-number }}
96+ tag_name : ${{ steps.vsix_version.outputs.next-tag }}
97+ release_name : Release ${{ steps.vsix_version.outputs.next-tag }}
9098 draft : false
9199 prerelease : false
92- - name : Upload Release Asset
93- id : upload-release-asset
100+
101+ - name : Upload GitHub Release 2015-2019 Asset
94102 uses : actions/upload-release-asset@v1
95103 env :
96104 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
97105 with :
98- upload_url : ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
106+ upload_url : ${{ steps.create_release.outputs.upload_url }}
99107 asset_path : .\Snyk.VisualStudio.Extension\bin\Release\Snyk.VisualStudio.Extension.vsix
100- asset_name : Snyk_Vulnerability_Scanner-${{ steps.vsix_version.outputs.version-number }}.vsix
108+ asset_name : Snyk_Vulnerability_Scanner-${{ steps.vsix_version.outputs.next-tag }}.vsix
101109 asset_content_type : application/zip
102-
110+
111+ - name : Upload GitHub Release 2022 Asset
112+ uses : actions/upload-release-asset@v1
113+ env :
114+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
115+ with :
116+ upload_url : ${{ steps.create_release.outputs.upload_url }}
117+ asset_path : .\Snyk.VisualStudio.Extension.2022\bin\Release\Snyk.VisualStudio.Extension.vsix
118+ asset_name : Snyk_Vulnerability_Scanner-${{ steps.vsix_version.outputs.next-tag }}-2022.vsix
119+ asset_content_type : application/zip
120+
103121 - name : Publish 2015-2019 extension to Marketplace
104122 uses : cezarypiatek/VsixPublisherAction@0.1
105123 with :
106124 extension-file : ' .\Snyk.VisualStudio.Extension\bin\Release\Snyk.VisualStudio.Extension.vsix'
107125 publish-manifest-file : ' .\Snyk.VisualStudio.Extension\vs-publish.json'
108126 personal-access-code : ${{ secrets.VS_PUBLISHER_ACCESS_TOKEN }}
127+
128+ - name : Publish 2022 extension to Marketplace
129+ uses : cezarypiatek/VsixPublisherAction@0.1
130+ with :
131+ extension-file : ' .\Snyk.VisualStudio.Extension.2022\bin\Release\Snyk.VisualStudio.Extension.vsix'
132+ publish-manifest-file : ' .\Snyk.VisualStudio.Extension.2022\vs-publish.json'
133+ personal-access-code : ${{ secrets.VS_PUBLISHER_ACCESS_TOKEN }}
0 commit comments