Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
d63c85e
Model with dictionary property
darrelmiller Nov 14, 2021
e701eaf
Added some samples
darrelmiller Nov 14, 2021
752f0c3
experiment with VS integration
darrelmiller Dec 2, 2021
6acec28
Added nuspec for ApiDescription package
darrelmiller Dec 25, 2021
1786bd8
Update src/Kiota.ApiDescription.Client/Kiota.ApiDescription.Client.nu…
baywet Feb 11, 2022
aecee1e
- fixes failing unit tests
baywet May 4, 2022
34c178d
- adds missing unit test after merge
baywet May 4, 2022
c09c593
- renames reference package
baywet May 4, 2022
05c3747
- renames kiota tool package
baywet May 4, 2022
833264d
- adds azure devops pipeline definition for public release
baywet May 5, 2022
f426384
- fixes policheck test path
baywet May 5, 2022
9ecf3e5
- fixes tests path for credscan
baywet May 5, 2022
5488975
- fixes pack commands
baywet May 5, 2022
4cfab8c
- another attempt at fixing the pack comand
baywet May 5, 2022
3bc2aad
- switched to cli instead of broken tasks
baywet May 5, 2022
39a58bc
- typo fix
baywet May 5, 2022
7288c40
- switches to CLI for dotnet publish
baywet May 5, 2022
a975454
- updates docker worfklow to push to MCR
baywet May 5, 2022
119935f
- adds changelog entry for public release
baywet May 5, 2022
f8da493
- fixes exe publication for kiota
baywet May 5, 2022
d2cf6fd
- removes the dotnet text project that should have been removed durin…
baywet May 5, 2022
9acf492
- updates public documentation after public release
baywet May 5, 2022
9d5f394
- updates broken links in docker file
baywet May 5, 2022
f8dc830
- disables condition for deployment test
baywet May 5, 2022
25b53ae
- fixes non-compliant nuget fields
baywet May 5, 2022
a85a311
- fixes wrong copyright on main package
baywet May 5, 2022
db57259
Revert "- disables condition for deployment test"
baywet May 5, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
299 changes: 299 additions & 0 deletions .azure-pipelines/ci-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,299 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.

name: $(BuildDefinitionName)_$(SourceBranchName)_$(Date:yyyyMMdd)$(Rev:.r)

trigger:
tags:
include:
- v*

pool:
name: Azure Pipelines
vmImage: windows-latest

variables:
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
ProductBinPath: '$(Build.SourcesDirectory)\src\kiota\bin\$(BuildConfiguration)'


stages:

- stage: build
jobs:
- job: build
steps:
- task: UseDotNet@2
displayName: 'Use .NET 6'
inputs:
version: 6.x

- task: PoliCheck@1
displayName: 'Run PoliCheck "/src"'
inputs:
inputType: CmdLine
cmdLineArgs: '/F:$(Build.SourcesDirectory)/src /T:9 /Sev:"1|2" /PE:2 /O:poli_result_src.xml'

- task: PoliCheck@1
displayName: 'Run PoliCheck "/tests"'
inputs:
inputType: CmdLine
cmdLineArgs: '/F:$(Build.SourcesDirectory)/tests /T:9 /Sev:"1|2" /PE:2 /O:poli_result_test.xml'

# Install the nuget tool.
- task: NuGetToolInstaller@0
displayName: 'Use NuGet >=6.1.0'
inputs:
versionSpec: '>=6.1.0'
checkLatest: true

# Build the Product project
- task: DotNetCoreCLI@2
displayName: 'build'
inputs:
projects: '$(Build.SourcesDirectory)\kiota.sln'
arguments: '--configuration $(BuildConfiguration) --no-incremental'

# Run the Unit test
- task: DotNetCoreCLI@2
displayName: 'test'
inputs:
command: test
projects: '$(Build.SourcesDirectory)\kiota.sln'
arguments: '--configuration $(BuildConfiguration) --no-build'

# CredScan
- task: securedevelopmentteam.vss-secure-development-tools.build-task-credscan.CredScan@2
displayName: 'Run CredScan - Src'
inputs:
toolMajorVersion: 'V2'
scanFolder: '$(Build.SourcesDirectory)\src'
debugMode: false

- task: securedevelopmentteam.vss-secure-development-tools.build-task-credscan.CredScan@2
displayName: 'Run CredScan - Tests'
inputs:
toolMajorVersion: 'V2'
scanFolder: '$(Build.SourcesDirectory)\tests'
debugMode: false

- task: AntiMalware@3
displayName: 'Run MpCmdRun.exe - ProductBinPath'
inputs:
FileDirPath: '$(ProductBinPath)'
enabled: false

- task: BinSkim@3
displayName: 'Run BinSkim - Product Binaries'
inputs:
InputType: Basic
AnalyzeTarget: '$(ProductBinPath)\**\kiota.dll'
AnalyzeSymPath: '$(ProductBinPath)'
AnalyzeVerbose: true
AnalyzeHashes: true
AnalyzeEnvironment: true

- task: PublishSecurityAnalysisLogs@2
displayName: 'Publish Security Analysis Logs'
inputs:
ArtifactName: SecurityLogs

- task: PostAnalysis@1
displayName: 'Post Analysis'
inputs:
BinSkim: true
CredScan: true
PoliCheck: true

- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
displayName: 'ESRP CodeSigning'
inputs:
ConnectedServiceName: 'microsoftgraph ESRP CodeSign DLL and NuGet (AKV)'
FolderPath: src
signConfigType: inlineSignParams
inlineOperation: |
[
{
"keyCode": "CP-230012",
"operationSetCode": "SigntoolSign",
"parameters": [
{
"parameterName": "OpusName",
"parameterValue": "Microsoft"
},
{
"parameterName": "OpusInfo",
"parameterValue": "http://www.microsoft.com"
},
{
"parameterName": "FileDigest",
"parameterValue": "/fd \"SHA256\""
},
{
"parameterName": "PageHash",
"parameterValue": "/NPH"
},
{
"parameterName": "TimeStamp",
"parameterValue": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256"
}
],
"toolName": "sign",
"toolVersion": "1.0"
},
{
"keyCode": "CP-230012",
"operationSetCode": "SigntoolVerify",
"parameters": [ ],
"toolName": "sign",
"toolVersion": "1.0"
}
]
SessionTimeout: 20

# Pack
- pwsh: dotnet pack $(Build.SourcesDirectory)/src/kiota/kiota.csproj -o $(Build.ArtifactStagingDirectory) --configuration $(BuildConfiguration) --no-build --include-symbols --include-source /p:SymbolPackageFormat=snupkg
displayName: 'pack kiota'

# Pack
- pwsh: nuget pack $(Build.SourcesDirectory)/src/Microsoft.OpenApi.Kiota.ApiDescription.Client/Microsoft.OpenApi.Kiota.ApiDescription.Client.nuspec -OutputDirectory $(Build.ArtifactStagingDirectory)
displayName: 'pack targets'

- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
displayName: 'ESRP CodeSigning Nuget Packages'
inputs:
ConnectedServiceName: 'microsoftgraph ESRP CodeSign DLL and NuGet (AKV)'
FolderPath: '$(Build.ArtifactStagingDirectory)'
Pattern: '*.nupkg'
signConfigType: inlineSignParams
inlineOperation: |
[
{
"keyCode": "CP-401405",
"operationSetCode": "NuGetSign",
"parameters": [ ],
"toolName": "sign",
"toolVersion": "1.0"
},
{
"keyCode": "CP-401405",
"operationSetCode": "NuGetVerify",
"parameters": [ ],
"toolName": "sign",
"toolVersion": "1.0"
}
]
SessionTimeout: 20

- task: PowerShell@2
displayName: "Get Kiota's version-number from .csproj"
inputs:
targetType: 'inline'
script: |
$xml = [Xml] (Get-Content .\src\kiota\kiota.csproj)
$version = $xml.Project.PropertyGroup.Version
echo $version
echo "##vso[task.setvariable variable=kiotaversion]$version"

# publish kiota as an .exe
- pwsh: dotnet publish src/kiota/kiota.csproj -c Release --runtime win-x64 /p:PublishSingleFile=true --self-contained --output $(Build.ArtifactStagingDirectory)/kiota-v$(kiotaversion)
displayName: publish kiota as executable

- task: CopyFiles@2
displayName: Prepare staging folder for upload
inputs:
targetFolder: $(Build.ArtifactStagingDirectory)/Nugets
sourceFolder: $(Build.ArtifactStagingDirectory)
content: '*.nupkg'

- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: Nugets'
inputs:
ArtifactName: Nugets
PathtoPublish: '$(Build.ArtifactStagingDirectory)/Nugets'

- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: Kiota'
inputs:
ArtifactName: Kiota-v$(kiotaversion)
PathtoPublish: '$(Build.ArtifactStagingDirectory)/Kiota-v$(kiotaversion)'

- stage: deploy
condition: and(contains(variables['build.sourceBranch'], 'refs/tags/v'), succeeded())
dependsOn: build
jobs:
- deployment: deploy_kiota
dependsOn: []
environment: nuget-org
strategy:
runOnce:
deploy:
pool:
vmImage: ubuntu-latest
steps:
- task: DownloadPipelineArtifact@2
displayName: Download nupkg from artifacts
inputs:
artifact: Nugets
source: current
- task: DownloadPipelineArtifact@2
displayName: Download kiota executable from artifacts
inputs:
source: current
- powershell: |
rm "$(Pipeline.Workspace)/Nugets/Microsoft.OpenApi.Kiota.ApiDescription.*.nupkg" -Verbose
displayName: remove other nupkgs to avoid duplication
# - pwsh: |
# $artifactName = Get-ChildItem -Path $(Pipeline.Workspace)\Nugets -Filter Microsoft.OpenApi.Kiota.*.nupkg -recurse | select -First 1
# $artifactVersion= $artifactName.Name -replace "Microsoft.OpenApi.Kiota.", "" -replace ".nupkg", ""
# #Set Variable $artifactName and $artifactVersion
# Write-Host "##vso[task.setvariable variable=artifactVersion; isSecret=false; isOutput=true]$artifactVersion"
# Write-Host "##vso[task.setvariable variable=artifactName; isSecret=false; isOutput=true]$artifactName.FullName"
# echo "$artifactName"
# echo "$artifactVersion"
# displayName: 'Fetch Artifact Name'

- task: NuGetCommand@2
displayName: 'NuGet push'
inputs:
command: push
packagesToPush: '$(Pipeline.Workspace)/Nugets/Microsoft.OpenApi.Kiota.*.nupkg'
nuGetFeedType: external
publishFeedCredentials: 'OpenAPI Nuget Connection'
# - task: GitHubRelease@1
# displayName: 'GitHub release (create)'
# inputs:
# gitHubConnection: 'Github-MaggieKimani1'
# tagSource: userSpecifiedTag
# tag: '$(artifactVersion)'
# title: '$(artifactVersion)'
# releaseNotesSource: inline
# assets: '$(Pipeline.Workspace)\**\*.exe'
# changeLogType: issueBased

- deployment: deploy_targets
dependsOn: []
environment: nuget-org
strategy:
runOnce:
deploy:
pool:
vmImage: ubuntu-latest
steps:
- task: DownloadPipelineArtifact@2
displayName: Download nupkg from artifacts
inputs:
artifact: Nugets
source: current
- powershell: |
rm "$(Pipeline.Workspace)/Nugets/Microsoft.OpenApi.Kiota.*.nupkg" -Verbose -Exclude "*.ApiDescription.*"
displayName: remove other nupkgs to avoid duplication
- task: NuGetCommand@2
displayName: 'NuGet push'
inputs:
command: push
packagesToPush: '$(Pipeline.Workspace)/Nugets/Microsoft.OpenApi.Kiota.ApiDescription.*.nupkg'
nuGetFeedType: external
publishFeedCredentials: 'OpenAPI Nuget Connection'

12 changes: 6 additions & 6 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@ on:
tags: ['v*']
paths: ['src/**', '.github/workflows/**']
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}/generator
REGISTRY: msgraphprod.azurecr.io
IMAGE_NAME: public/${{ github.repository }}/generator
jobs:
push_to_registry:
environment:
name: staging_feeds
name: Push Docker image to GitHub Packages
name: acr
name: Push Docker image
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Login to GitHub package feed
uses: docker/[email protected]
with:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
username: ${{ secrets.ACR_USERNAME }}
password: ${{ secrets.ACR_PASSWORD }}
registry: ${{ env.REGISTRY }}
- run: |
$version = $Env:BRANCH_NAME -replace "refs/tags/v",""
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

### [0.1.0] - 2022-05-04

### Added

- The dotnet tool is now available on the public feed `dotnet tool install -g Microsoft.OpenApi.Kiota --prerelease`.
- The dotnet OpenApi reference package is now available `Microsoft.OpenApi.Kiota.ApiDescription.Client`.
- The container image is now available on mcr. `docker pull mcr.microsoft.com/kiota/generator:latest`.

### Changed

- Revamped the api surface for request configuration. [#1494](https://github.com/microsoft/kiota/issues/1494)
- Fixed a bug in methods naming in Go after request configuration revamp.
- Fixes a bug where reserved names would not be updated for inheritance.
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ VOLUME /app/output
VOLUME /app/openapi.yml
ENTRYPOINT ["dotnet", "kiota.dll"]
LABEL description="# Welcome to Kiota Generator \
To start generating SDKs checkout [the getting started documentation](https://github.com/microsoft/kiota/#running-kiota-with-docker) \
[Source dockerfile](https://github.com/microsoft/kiota/blob/main/releases/Dockerfile)"
To start generating SDKs checkout [the getting started documentation](https://microsoft.github.io/kiota/get-started/#run-in-docker) \
[Source dockerfile](https://github.com/microsoft/kiota/blob/main/Dockerfile)"
2 changes: 1 addition & 1 deletion docs/get-started/dotnet.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ parent: Get started

## Target project requirements

Before you can compile and run the generated files, you will need to make sure they are part of a project with the required dependencies. After creating a new project, or reusing an existing one, you will need to add references to the [abstraction](https://github.com/microsoft/kiota/tree/main/abstractions/dotnet), [authentication](https://github.com/microsoft/kiota/tree/main/authentication/dotnet/azure), [http](https://github.com/microsoft/kiota/tree/main/http/dotnet/httpclient), and [serialization](https://github.com/microsoft/kiota/tree/main/serialization/dotnet/json) packages from the GitHub feed.
Before you can compile and run the generated files, you will need to make sure they are part of a project with the required dependencies. After creating a new project, or reusing an existing one, you will need to add references to the [abstraction](https://github.com/microsoft/kiota-abstractions-dotnet), [authentication](https://github.com/microsoft/kiota-authentication-azure-dotnet), [http](https://github.com/microsoft/kiota-http-dotnet), and [JSON](https://github.com/microsoft/kiota-serialization-json-dotnet) and [text](https://github.com/microsoft/kiota-serialization-text-dotnet) serialization packages from the GitHub feed.

## Creating target projects

Expand Down
Loading