Design improvements #11
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
| # yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json | |
| name: "Build" | |
| permissions: | |
| actions: write | |
| contents: write | |
| on: | |
| push: | |
| branches: [master] | |
| pull_request: | |
| branches: [master] | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| outputs: | |
| version: ${{ steps.vsix_version.outputs.version-number }} | |
| name: Build | |
| runs-on: windows-latest | |
| env: | |
| Configuration: Release | |
| DeployExtension: False | |
| VsixManifestPath: src\source.extension.vsixmanifest | |
| VsixManifestSourcePath: src\source.extension1.cs | |
| steps: | |
| - uses: actions/checkout@5 | |
| - name: Setup MSBuild | |
| uses: microsoft/setup-msbuild@v3 | |
| - name: Cache NuGet packages | |
| uses: actions/cache@v5 | |
| with: | |
| path: ~/.nuget/packages | |
| key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.slnx', '**/*.sln', '**/*.csproj', '**/packages.config', '**/packages.lock.json', '**/nuget.config') }} | |
| restore-keys: | | |
| ${{ runner.os }}-nuget- | |
| - name: Increment VSIX version | |
| id: vsix_version | |
| uses: timheuer/vsix-version-stamp@v2 | |
| with: | |
| manifest-file: ${{ env.VsixManifestPath }} | |
| vsix-token-source-file: ${{ env.VsixManifestSourcePath }} | |
| - name: Build | |
| run: msbuild /v:m -restore /p:OutDir=\_built | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: ${{ github.event.repository.name }}.vsix | |
| path: /_built/**/*.vsix | |
| publish: | |
| if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }} | |
| needs: build | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Download Package artifact | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: ${{ github.event.repository.name }}.vsix | |
| - name: Upload to Open VSIX | |
| uses: timheuer/openvsixpublish@v1 | |
| with: | |
| vsix-file: ${{ github.event.repository.name }}.vsix | |
| - name: Publish extension to Marketplace | |
| if: ${{ github.event_name == 'workflow_dispatch' || contains(github.event.head_commit.message, '[release]') }} | |
| uses: cezarypiatek/VsixPublisherAction@1.1 | |
| with: | |
| extension-file: '${{ github.event.repository.name }}.vsix' | |
| publish-manifest-file: 'vs-publish.json' | |
| personal-access-code: ${{ secrets.VS_PUBLISHER_ACCESS_TOKEN }} | |
| - name: Tag and release | |
| if: ${{ github.event_name == 'workflow_dispatch' || contains(github.event.head_commit.message, '[release]') }} | |
| id: tag_release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| body: release ${{ needs.build.outputs.version }} | |
| generate_release_notes: true | |
| tag_name: ${{ needs.build.outputs.version }} | |
| files: | | |
| **/*.vsix |