Update the extension to use the dll from the project #67
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: "Build" | |
permissions: | |
actions: write | |
contents: write | |
env: | |
VERSION: 1.0.${{ github.run_number }} | |
NUGET_REPO_URL: "https://api.nuget.org/v3/index.json" | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
branches: ["main"] | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Sets environment variables - branch-name | |
uses: nelonoel/branch-name@v1.0.1 | |
- name: Sets environment variables - Nerdbank.GitVersioningi | |
uses: dotnet/nbgv@master | |
with: | |
setAllVars: true | |
- name: Update Version | |
run: | | |
(Get-Content -Path NoVar/source.extension.vsixmanifest -Raw) -Replace 'Version="1.0.0"', 'Version="${{ env.VERSION }}"' | Set-Content -Path NoVar/source.extension.vsixmanifest | |
- name: Restore | |
run: dotnet restore NoVarExtension.sln | |
- name: Setup MSBuild.exe | |
uses: microsoft/setup-msbuild@v2 | |
- name: Build | |
run: msbuild NoVarExtension.sln /property:Configuration=Release /t:Rebuild | |
- name: Run UnitTests | |
run: dotnet test NoVarTest/NoVarTests.csproj -c Release --no-build | |
- name: Move build output | |
run: mv bin/Release/NoVar.vsix NoVar-${{ env.VERSION }}.vsix | |
working-directory: NoVar | |
- name: Publish artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Visual Studio Extension | |
path: Novar/*.vsix | |
- name: Publish VSIX Packages | |
continue-on-error: true | |
run: | | |
$VsixPublisher = "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VSSDK\VisualStudioIntegration\Tools\Bin\VsixPublisher.exe" | |
& $VsixPublisher login -personalAccessToken "${{ secrets.PERSONALACCESSTOKEN }}" -publisherName PrabhathKiranAtmakuri | |
& $VsixPublisher publish -payload Novar/NoVar-${{ env.VERSION }}.vsix -publishManifest NoVar/publish-manifest.json -ignoreWarnings 'VSIXValidatorWarning01,VSIXValidatorWarning02' | |
- name: debug | |
run: | | |
echo $env:VERSION | |
echo (Get-Content -Path NoVar/source.extension.vsixmanifest -Raw) | |
Tag: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Create tag | |
uses: actions/github-script@v7 | |
with: | |
github-token: ${{ github.token }} | |
script: | | |
github.rest.git.createRef({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
ref: "refs/tags/${{ env.VERSION }}", | |
sha: context.sha | |
}) | |
- name: Create release | |
id: create-release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ env.VERSION }} | |
release_name: v${{ env.VERSION }} | |
draft: true | |
prerelease: false | |
- uses: actions/download-artifact@v4 | |
with: | |
path: artifacts | |
- name: Upload VSIX asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create-release.outputs.upload_url }} | |
asset_path: artifacts/Visual Studio Extension/NoVar-${{ env.VERSION }}.vsix | |
asset_name: NoVar-${{ env.VERSION }}.vsix | |
asset_content_type: application/zip |