Skip to content

Commit

Permalink
Fix script uploading release assets
Browse files Browse the repository at this point in the history
  • Loading branch information
bothzoli committed Dec 29, 2024
1 parent 4050e01 commit 770cd3f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,9 @@ stages:

- script: |
curl -X POST -s -H '$(contentTypeHeader1)' -H '$(authHeader)' https://api.github.com/repos/vkhorikov/CSharpFunctionalExtensions/releases -d '$(createReleaseRequest)'
$json = Invoke-RestMethod -Method 'GET' -Uri "https://api.github.com/repos/vkhorikov/CSharpFunctionalExtensions/releases/latest"
$releaseId = $json.id
curl -X POST -s -H '$(acceptHeader)' -H '$(apiVersionHeader)' -H '$(contentTypeHeader2)' -H '$(authHeader)' --data-binary '@$(Pipeline.Workspace)/NuGetPackage/CSharpFunctionalExtensions.$(newVersion).nupkg' 'https://uploads.github.com/repos/vkhorikov/CSharpFunctionalExtensions/releases/$(releaseId)/assets?name=CSharpFunctionalExtensions.$(newVersion).nupkg'
curl -X POST -s -H '$(acceptHeader)' -H '$(apiVersionHeader)' -H '$(contentTypeHeader2)' -H '$(authHeader)' --data-binary '@$(Pipeline.Workspace)/NuGetPackageStrongName/CSharpFunctionalExtensions.StrongName.$(newVersion).nupkg' 'https://uploads.github.com/repos/vkhorikov/CSharpFunctionalExtensions/releases/$(releaseId)/assets?name=CSharpFunctionalExtensions.StrongName.$(newVersion).nupkg'
releaseId=$(curl -s https://api.github.com/repos/vkhorikov/CSharpFunctionalExtensions/releases/latest | grep -o '"id": [0-9]*' | head -n 1 | sed 's/"id": //')
curl -X POST -s -H '$(acceptHeader)' -H '$(apiVersionHeader)' -H '$(contentTypeHeader2)' -H '$(authHeader)' --data-binary '@$(Pipeline.Workspace)/NuGetPackage/CSharpFunctionalExtensions.$(newVersion).nupkg' "https://uploads.github.com/repos/vkhorikov/CSharpFunctionalExtensions/releases/$releaseId/assets?name=CSharpFunctionalExtensions.$(newVersion).nupkg"
curl -X POST -s -H '$(acceptHeader)' -H '$(apiVersionHeader)' -H '$(contentTypeHeader2)' -H '$(authHeader)' --data-binary '@$(Pipeline.Workspace)/NuGetPackageStrongName/CSharpFunctionalExtensions.StrongName.$(newVersion).nupkg' "https://uploads.github.com/repos/vkhorikov/CSharpFunctionalExtensions/releases/$releaseId/assets?name=CSharpFunctionalExtensions.StrongName.$(newVersion).nupkg"
displayName: Publish to GitHub
condition: and(succeeded(), ne(variables.gitHubToken, ''))
Expand Down

0 comments on commit 770cd3f

Please sign in to comment.