CM-41236 - Code refactoring (#31) #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Lint and build. Publish on tag/release creation | |
on: [ push ] | |
permissions: | |
contents: write | |
jobs: | |
lint_build_publish: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Add msbuild to PATH | |
uses: microsoft/setup-msbuild@v2 | |
with: | |
vs-version: '[17.0, )' | |
- name: Format check | |
run: dotnet format --verify-no-changes --verbosity diagnostic | |
- uses: actions/cache@v4 | |
with: | |
path: ~/.nuget/packages | |
key: nuget-${{ hashFiles('**/*.csproj') }} | |
restore-keys: nuget- | |
- name: Restore NuGet packages | |
run: | | |
nuget restore src\extension\Cycode.VisualStudio.Extension.14.0-16.0\Cycode.VisualStudio.Extension.14.0-16.0.csproj | |
nuget restore src\extension\Cycode.VisualStudio.Extension.17.0\Cycode.VisualStudio.Extension.17.0.csproj | |
- name: Build Cycode.VisualStudio.Extension | |
run: | | |
msbuild src\extension\Cycode.VisualStudio.Extension.14.0-16.0\Cycode.VisualStudio.Extension.14.0-16.0.csproj /t:Rebuild /p:Configuration=Release | |
msbuild src\extension\Cycode.VisualStudio.Extension.17.0\Cycode.VisualStudio.Extension.17.0.csproj /t:Rebuild /p:Configuration=Release | |
env: | |
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
DeployExtension: False | |
- name: Upload Cycode.VisualStudio.Extension.14.0-16.0 artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Cycode.VisualStudio.Extension.14.0-16.0 | |
if-no-files-found: error | |
# We don't use a wildcard pattern here because the path hierarchy is preserved | |
path: src/extension/Cycode.VisualStudio.Extension.14.0-16.0/bin/Release/Cycode.VisualStudio.Extension.14.0-16.0.vsix | |
- name: Upload Cycode.VisualStudio.Extension.17.0 artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Cycode.VisualStudio.Extension.17.0 | |
if-no-files-found: error | |
# We don't use a wildcard pattern here because the path hierarchy is preserved | |
path: src/extension/Cycode.VisualStudio.Extension.17.0/bin/Release/Cycode.VisualStudio.Extension.17.0.vsix | |
- name: Publish Cycode.VisualStudio.Extension.14.0-16.0 to marketplace | |
# it runs on tag creation only which starts with 'v' (e.g., v1.0.0) | |
if: startsWith(github.ref, 'refs/tags/v') | |
run: | | |
$VsixPublisher = "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VSSDK\VisualStudioIntegration\Tools\Bin\VsixPublisher.exe" | |
& $VsixPublisher login -personalAccessToken ${{ secrets.VSCODE_MARKETPLACE_TOKEN }} -publisherName cycode | |
& $VsixPublisher.exe publish -payload "src/extension/Cycode.VisualStudio.Extension.14.0-16.0/bin/Release/Cycode.VisualStudio.Extension.14.0-16.0.vsix" -publishManifest "src/extension/Cycode.VisualStudio.Extension.14.0-16.0/publishManifest.json" | |
- name: Publish Cycode.VisualStudio.Extension.17.0 to marketplace | |
# it runs on tag creation only which starts with 'v' (e.g., v1.0.0) | |
if: startsWith(github.ref, 'refs/tags/v') | |
run: | | |
$VsixPublisher = "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VSSDK\VisualStudioIntegration\Tools\Bin\VsixPublisher.exe" | |
& $VsixPublisher login -personalAccessToken ${{ secrets.VSCODE_MARKETPLACE_TOKEN }} -publisherName cycode | |
& $VsixPublisher.exe publish -payload "src/extension/Cycode.VisualStudio.Extension.17.0/bin/Release/Cycode.VisualStudio.Extension.17.0.vsix" -publishManifest "src/extension/Cycode.VisualStudio.Extension.17.0/publishManifest.json" | |
- name: Publish Cycode.VisualStudio.Extension.14.0-16.0 to GitHub Release | |
# it runs on tag creation only which starts with 'v' (e.g., v1.0.0) | |
if: startsWith(github.ref, 'refs/tags/v') | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
file: src/extension/Cycode.VisualStudio.Extension.14.0-16.0/bin/Release/Cycode.VisualStudio.Extension.14.0-16.0.vsix | |
tag: ${{ github.ref }} | |
overwrite: true | |
- name: Publish Cycode.VisualStudio.Extension.17.0 to GitHub Release | |
# it runs on tag creation only which starts with 'v' (e.g., v1.0.0) | |
if: startsWith(github.ref, 'refs/tags/v') | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
file: src/extension/Cycode.VisualStudio.Extension.17.0/bin/Release/Cycode.VisualStudio.Extension.17.0.vsix | |
tag: ${{ github.ref }} | |
overwrite: true |