Merge azure devops integration #2
Workflow file for this run
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: CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
types: [opened, synchronize, reopened] | |
branches: | |
- main | |
jobs: | |
build-tools: | |
name: Build Tools | |
runs-on: windows-2022 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: '5.0.x' | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: '7.0.100' | |
- name: Setup GitVersion | |
uses: gittools/actions/gitversion/[email protected] | |
with: | |
versionSpec: '5.6.x' | |
- name: GitVersion | |
id: gitversion | |
uses: gittools/actions/gitversion/[email protected] | |
with: | |
useConfigFile: true | |
configFilePath: gitversion.yml | |
- name: Build - CI | |
run: | | |
$adjustedPackageVersion="${{ steps.gitversion.outputs.semVer }}".ToLower(); | |
dotnet build src/NvGet.sln /p:PackageVersion=$adjustedPackageVersion /p:Version=${{ steps.gitversion.outputs.assemblySemVer }} "/p:PackageOutputPath=$env:GITHUB_WORKSPACE\artifacts" /p:GeneratePackageOnBuild=true | |
- name: Run Unit Tests | |
run: | | |
cd src | |
dotnet test | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: NuGet | |
path: .\artifacts | |
build-extensions: | |
name: Build Extensions | |
runs-on: windows-2022 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Install tfx | |
working-directory: extensions/azuredevops | |
run: npm install [email protected] -g --no-audit --no-fund | |
- name: npm install | |
working-directory: extensions/azuredevops | |
run: npm install [email protected] -g --no-audit --no-fund | |
- name: Compile | |
working-directory: extensions/azuredevops | |
run: .\node_modules\.bin\tsc -project .\tsconfig.json --listEmittedFiles --locale en-US --isolatedModules | |
- name: Package Extension | |
working-directory: extensions/azuredevops | |
run: tfx extension create --json --no-color --output-path .\artifacts\Build.Tasks.$(GitVersion.MajorMinorPatch).vsix --override "{\"version\":\"$(GitVersion.MajorMinorPatch)\"}" | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: extensions | |
path: .\artifacts | |
publish-tools: | |
name: Publish | |
if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/develop' || startsWith(github.ref, 'refs/heads/master')) }} | |
runs-on: windows-latest | |
needs: | |
- build-tools | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Download Artifacts | |
uses: actions/download-artifact@v2 | |
with: | |
name: NuGet | |
path: artifacts | |
- name: Setup .NET SDK | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: '3.1.x' | |
- name: NuGet Push | |
run: | | |
dotnet nuget push artifacts\*.nupkg -s https://api.nuget.org/v3/index.json -k ${{ secrets.NUGET_ORG_API_KEY }} |