Merge pull request #174 from sboulema/feature/compact_#172 #150
This file contains hidden or 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: CodeNav | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - 'feature/**' | |
| env: | |
| version: '10.8.${{ github.run_number }}' | |
| dotnetVersion: '8' | |
| repoUrl: ${{ github.server_url }}/${{ github.repository }} | |
| vsixPath: src/CodeNav/bin/Release/net472/CodeNav.vsix | |
| vsixManifestPath: ${{ github.workspace }}/src/CodeNav/source.extension.vsixmanifest | |
| jobs: | |
| build: | |
| name: 🛠️ Build | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: ${{ env.dotnetVersion }}.x | |
| - name: Restore/Build/Test | |
| run: dotnet test | |
| - name: Update Vsix Manifest Version | |
| id: vsix_version | |
| uses: timheuer/vsix-version-stamp@v2 | |
| with: | |
| version-number: ${{ env.version }} | |
| manifest-file: ${{ env.vsixManifestPath }} | |
| - name: Build VSIX | |
| run: dotnet publish src/CodeNav -p:Version=${{ env.version }} -c Release | |
| - name: Publish Build Artifacts | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: CodeNav | |
| path: | | |
| ${{ github.workspace }}/${{ env.vsixPath }} | |
| publish-manifest.json | |
| README.md | |
| build2022: | |
| name: 🛠️ Build 2022 | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: ${{ env.dotnetVersion }}.x | |
| - name: Restore/Build/Test | |
| run: dotnet test | |
| - name: Update Vsix DisplayName and Id | |
| run: | | |
| [xml]$vsixXml = Get-Content ${{ env.vsixManifestPath }} | |
| $ns = New-Object System.Xml.XmlNamespaceManager $vsixXml.NameTable | |
| $ns.AddNamespace("ns", $vsixXml.DocumentElement.NamespaceURI) | Out-Null | |
| $attrId = $vsixXml.SelectSingleNode("//ns:Identity", $ns).Attributes["Id"] | |
| $attrId.InnerText = "dcdbcca4-3a88-432f-ba04-eb4a4cb64437" | |
| $nodeDisplayName = $vsixXml.SelectSingleNode("//ns:DisplayName", $ns) | |
| $nodeDisplayName.InnerText = "CodeNav 2022" | |
| $vsixXml.Save("${{ env.vsixManifestPath }}") | Out-Null | |
| - name: Update Vsix Manifest Version | |
| id: vsix_version | |
| uses: timheuer/vsix-version-stamp@v2 | |
| with: | |
| version-number: ${{ env.version }} | |
| manifest-file: ${{ env.vsixManifestPath }} | |
| - name: Build VSIX | |
| run: dotnet publish src/CodeNav -p:Version=${{ env.version }} -c Release | |
| - name: Publish Build Artifacts | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: CodeNav2022 | |
| path: | | |
| ${{ github.workspace }}/${{ env.vsixPath }} | |
| publish-manifest-2022.json | |
| README.md | |
| release: | |
| if: github.ref_name == 'main' | |
| name: 🚚 Release | |
| needs: [build, build2022] | |
| runs-on: windows-latest | |
| environment: Release | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Download artifact | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: CodeNav | |
| - name: Tag release | |
| id: tag_release | |
| uses: mathieudutour/github-tag-action@v6.2 | |
| with: | |
| custom_tag: '${{ env.version }}' | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Create a GitHub release | |
| uses: ncipollo/release-action@v1.21.0 | |
| with: | |
| tag: ${{ steps.tag_release.outputs.new_tag }} | |
| name: ${{ steps.tag_release.outputs.new_tag }} | |
| body: ${{ steps.tag_release.outputs.changelog }} | |
| artifacts: ${{ github.workspace }}/${{ env.vsixPath }} | |
| skipIfReleaseExists: true | |
| publish: | |
| if: github.ref_name == 'main' | |
| name: 🚀 Publish | |
| needs: release | |
| runs-on: windows-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Download artifact | |
| uses: actions/download-artifact@v8 | |
| - name: Publish to Marketplace | |
| run: > | |
| & 'C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VSSDK/VisualStudioIntegration/Tools/Bin/VsixPublisher.exe' | |
| publish | |
| -personalAccessToken ${{ secrets.VS_PUBLISHER_ACCESS_TOKEN }} | |
| -payload ${{ github.workspace }}/CodeNav/${{ env.vsixPath }} | |
| -publishManifest CodeNav/publish-manifest.json | |
| - name: Publish to Marketplace 2022 | |
| run: > | |
| & 'C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VSSDK/VisualStudioIntegration/Tools/Bin/VsixPublisher.exe' | |
| publish | |
| -personalAccessToken ${{ secrets.VS_PUBLISHER_ACCESS_TOKEN }} | |
| -payload ${{ github.workspace }}/CodeNav2022/${{ env.vsixPath }} | |
| -publishManifest CodeNav2022/publish-manifest-2022.json | |
| - name: Publish to Open VSIX Gallery | |
| uses: timheuer/openvsixpublish@v1 | |
| with: | |
| vsix-file: ${{ github.workspace }}/CodeNav/${{ env.vsixPath }} |