Skip to content

Commit

Permalink
splitting steps, fixing manifest update
Browse files Browse the repository at this point in the history
  • Loading branch information
bc3tech committed Jun 12, 2024
1 parent 925fec0 commit 07f99e6
Showing 1 changed file with 40 additions and 20 deletions.
60 changes: 40 additions & 20 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,9 @@ on:

jobs:
build-and-test:
runs-on: windows-latest
runs-on: ubuntu-latest

steps:
- name: Setup MSBuild for NetFX
uses: microsoft/setup-msbuild@v2
with:
vs-version: 17.0

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
Expand All @@ -29,22 +24,37 @@ jobs:
with:
show-progress: false

- name: Restore NuGet packages
run: nuget restore .\DocGpt.sln

- name: Run unit tests
run: dotnet test .\DocGpt.Test\DocGpt.Test.csproj --configuration Release

run: dotnet test ./DocGpt.Test/DocGpt.Test.csproj --configuration Release

package-extension:
runs-on: windows-latest

steps:
- name: Setup MSBuild for NetFX
uses: microsoft/setup-msbuild@v2
with:
vs-version: 17.0

- name: Checkout code
uses: actions/checkout@v4
with:
show-progress: false

- name: Bump version
run: |
# Set version number as '1.0.<gh workflow run number>'
$NEW_VERSION = "1.0.$env:GITHUB_RUN_NUMBER"
# Use PowerShell to update the version in the VSIX manifest
$xml = xml
$xml.SelectSingleNode('//Version').InnerText = $NEW_VERSION
$xml.OuterXml | Set-Content -Path .\DocGpt.Vsix\source.extension.vsixmanifest
$xml = [xml](Get-Content -Path .\DocGpt.Vsix\source.extension.vsixmanifest)
$identityNode = $xml.PackageManifest.Metadata.Identity
$identityNode.SetAttribute('Version', $NEW_VERSION)
$xml.Save(".\DocGpt.Vsix\source.extension.vsixmanifest")
- name: Restore NuGet packages
run: nuget restore .\DocGpt.sln

- name: Build Extension
run: msbuild .\DocGpt.sln -p:Configuration=Release

Expand All @@ -57,9 +67,19 @@ jobs:
name: DocGpt.vsix
path: DocGpt.Vsix\bin\Release\DocGPT.vsix

# - name: Publish to marketplace
# uses: cezarypiatek/[email protected]
# with:
# extension-file: .\DocGpt.Vsix\bin\Release\DocGPT.vsix
# personal-access-code: ${{ secrets.VS_MARKETPLACE_TOKEN }}
# publish-manifest-file: .\DocGpt.Vsix\publishmanifest.json
# publish-to-marketplace:
# needs: package-extension
# runs-on: ubuntu-latest

# steps:
# - name: Download artifact
# uses: actions/download-artifact@v2
# with:
# name: DocGPT.vsix
# path: ./DocGPT.vsix
# - name: Publish to marketplace
# uses: cezarypiatek/[email protected]
# with:
# extension-file: ./DocGPT.vsix
# personal-access-code: ${{ secrets.VS_MARKETPLACE_TOKEN }}
# publish-manifest-file: ./DocGpt.Vsix/publishmanifest.json

0 comments on commit 07f99e6

Please sign in to comment.