Skip to content

Bump Azure.AI.OpenAI from 1.0.0-beta.17 to 2.1.0 in /DocGpt.Roslyn #45

Bump Azure.AI.OpenAI from 1.0.0-beta.17 to 2.1.0 in /DocGpt.Roslyn

Bump Azure.AI.OpenAI from 1.0.0-beta.17 to 2.1.0 in /DocGpt.Roslyn #45

Workflow file for this run

name: Build and Test
on:
pull_request:
branches:
- main
workflow_dispatch:
workflow_call:
outputs:
extVersion:
value: ${{ jobs.package-extension.outputs.extVersion }}
env:
EXTENSION_VERSION: 1.0.${{ github.run_number }}
jobs:
run-tests:
runs-on: ubuntu-latest
steps:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: "8.x"
- name: Checkout code
uses: actions/checkout@v4
with:
show-progress: false
- name: Run unit tests
run: dotnet test ./DocGpt.Test/DocGpt.Test.csproj --configuration Release
package-extension:
# VS extension packaging requires netfx, so have to run it on Windows
runs-on: windows-latest
outputs:
extVersion: ${{ env.EXTENSION_VERSION }}
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: |
# Use PowerShell to update the version in the VSIX manifest
$xml = [xml](Get-Content -Path .\DocGpt.Vsix\source.extension.vsixmanifest)
$identityNode = $xml.PackageManifest.Metadata.Identity
$identityNode.SetAttribute('Version', $env:EXTENSION_VERSION)
$xml.Save(".\DocGpt.Vsix\source.extension.vsixmanifest")
echo "extVersion=$env:EXTENSION_VERSION" >> "$env:GITHUB_OUTPUT"
# - name: Restore NuGet packages
# run: nuget restore .\DocGpt.sln
- name: Build Extension
run: msbuild .\DocGpt.sln /p:Configuration=Release /t:"Restore;Build"
- name: Store unsigned artifact
uses: actions/upload-artifact@v4
with:
name: DocGPT-unsigned.vsix
path: DocGpt.Vsix\bin\Release\DocGPT.vsix
retention-days: 1
sign-extension:
needs: package-extension
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
show-progress: false
sparse-checkout: |
lib/linux
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: DocGPT-unsigned.vsix
path: ./o
# TODO: Switch from prerelease when they ship a release version
- name: Sign Extension
shell: bash
env:
kv_name: ${{secrets.AZURE_KEYVAULT_NAME}}
kv_tenant: ${{ secrets.AZURE_TENANT_ID }}
kv_client: ${{ secrets.AZURE_CLIENT_ID }}
kv_secret: ${{ secrets.AZURE_CLIENT_SECRET }}
kv_cert: ${{ secrets.SIGNING_CERTIFICATE_NAME }}
run: |
dotnet tool install --tool-path signer sign --version 0.9.1-beta.24325.5
./signer/sign code azure-key-vault \
"./o/DocGPT.vsix" \
-kvu "https://${kv_name}.vault.azure.net" \
-kvt "${kv_tenant}" \
-kvi "${kv_client}" \
-kvs "${kv_secret}" \
-kvc "${kv_cert}" \
-d "DocGPT CodeSign Certificate" \
-u "https://bc3.tech/docgpt" \
-t "http://timestamp.digicert.com"
- name: Publish signed artifact
uses: actions/upload-artifact@v4
with:
name: DocGPT-signed.vsix
path: ./o/DocGPT.vsix