Skip to content

Commit

Permalink
Start publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
janpieterz committed Aug 13, 2024
1 parent 9b078e4 commit 295fa95
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 7 deletions.
Empty file added .github/workflows/nuget.yml
Empty file.
10 changes: 10 additions & 0 deletions publish/nuget.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
$sourceLocation = "../dist/csharp"
#Ensure we run this "from this folder" as we run it personally in a command line as well as through the perspective of builds.
Set-Location -Path "$PSScriptRoot"

if (-not (Test-Path -Path $sourceLocation -PathType Container)) {
throw "The source location '$sourceLocation' does not exist."
}

& dotnet pack $sourceLocation --configuration Release --include-source --include-symbols --output $sourceLocation
& dotnet nuget push "$sourceLocation/*.nupkg" --source "https://api.nuget.org/v3/index.json" --api-key $env:NUGET_API_KEY
3 changes: 2 additions & 1 deletion server/csharp.ps1
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
$version = &"$PSScriptRoot\get-version.ps1" -patchVersion "0"
$version = &"$PSScriptRoot\get-version.ps1" -patchVersion "1"
$additionalProperties = @{
packageName = "Trinsic.Connect.BackendClient"
packageVersion = $version
nullableReferenceTypes = "true"
modelPropertySorting = "alphabetical"
library = "httpclient"
useDateTimeOffset = "true"
validatable = "false"
}
& "$PSScriptRoot\generate-client.ps1" -language "csharp" -additionalProperties $additionalProperties
6 changes: 4 additions & 2 deletions server/generate-client.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ param (
[Parameter(Mandatory = $true)]
[string]$language,
[string]$swaggerFileOrUrl = "https://connect.trinsic.id/swagger/api/swagger.json",
[string]$outputFolder = "./dist/$language",
[string]$outputFolder = "../dist/$language",
[Parameter(Mandatory = $true)]
[hashtable]$additionalProperties
)
Expand Down Expand Up @@ -56,4 +56,6 @@ Write-Host "Generating $language SDK from $localSwaggerFilePath in $outputFolder

if ($LASTEXITCODE -ne 0) {
throw "Failed to generate SDK for $language from $localSwaggerFilePath to $outputFolder."
}
}

Write-Host "Generated $language SDK $outputFolder";
2 changes: 1 addition & 1 deletion server/go.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$version = &"$PSScriptRoot\get-version.ps1" -patchVersion "0"
$version = &"$PSScriptRoot\get-version.ps1" -patchVersion "1"
$additionalProperties = @{
packageName = "trinsic.id/connect-sdks/go"
packageVersion = $version
Expand Down
4 changes: 2 additions & 2 deletions server/java.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$version = &"$PSScriptRoot\get-version.ps1" -patchVersion "0"
$version = &"$PSScriptRoot\get-version.ps1" -patchVersion "1"
$additionalProperties = @{
apiPackage = "id.trinsic.connect.backendclient"
artifactVersion = $version
Expand All @@ -14,6 +14,6 @@ $additionalProperties = @{
developerName = "Trinsic"
developerOrganization = "Trinsic"
developerOrganizationUrl = "https://trinsic.id"
artifactDescription = "Trinsic Connect Backend Client"
artifactDescription = "'Trinsic Connect Backend Client'"
}
& "$PSScriptRoot\generate-client.ps1" -language "java" -additionalProperties $additionalProperties
2 changes: 1 addition & 1 deletion server/version.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"apiVersion": "0.2"
"apiVersion": "0.1"
}

0 comments on commit 295fa95

Please sign in to comment.