Skip to content

Commit

Permalink
Merge pull request #591 from bothzoli/fix/github-asset-upload
Browse files Browse the repository at this point in the history
Fix script uploading release assets
  • Loading branch information
vkhorikov authored Dec 29, 2024
2 parents 4050e01 + 770cd3f commit 0701f4f
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 0701f4f

Please sign in to comment.