Skip to content

Commit

Permalink
Try NuGetVersionV2ext
Browse files Browse the repository at this point in the history
  • Loading branch information
9swampy committed Apr 17, 2024
1 parent 8f7d8f7 commit dd8341b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,31 +79,34 @@ jobs:
$semVer = $json.SemVer
$fullSemVer = $json.FullSemVer
$nuGetVersionV2 = $json.NuGetVersionV2
$buildMetaDataPadded = $json.BuildMetaDataPadded
Write-Host $json
Write-Host $semVer
Write-Host $fullSemVer
Write-Host $nuGetVersionV2
Write-Host ${nuGetVersionV2}${buildMetaDataPadded}
echo "FullSemVer=$fullSemVer" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
echo "SemVer=$semVer" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
echo "NuGetVersionV2=$nuGetVersionV2" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
echo "NuGetVersionV2ext=${nuGetVersionV2}${buildMetaDataPadded}" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
- name: Build Release
run: msbuild $env:Solution_Name /p:Configuration=Release /p:Platform="Any CPU"

- name: Nuget pack
run: nuget pack Telnet.nuspec -Version $Env:FullSemVer
run: nuget pack Telnet.nuspec -Version $Env:NuGetVersionV2ext

# Navigate to repo->Settings->Actions and check PUBLISH_TO_GITHUB_PACKAGES
# https://github.com/settings/tokens to create a new classic token, permission write:packages, name & copy paste to PUBLISH_TO_GITHUB_PACKAGES
- name: Publish to GitHub
run: dotnet nuget push "Telnet.$Env:FullSemVer.nupkg" --api-key ${{ secrets.PUBLISH_TO_GITHUB_PACKAGES }} --source "https://nuget.pkg.github.com/9swampy/index.json"
run: dotnet nuget push "Telnet.$Env:NuGetVersionV2ext.nupkg" --api-key ${{ secrets.PUBLISH_TO_GITHUB_PACKAGES }} --source "https://nuget.pkg.github.com/9swampy/index.json"

#Login to Nuget 9swampy->Api Keys and regenerate, copy to NUGET_APIKEY
- name: Publish to Nuget
if: github.ref == 'refs/heads/master'
run: nuget push "Telnet.$Env:FullSemVer.nupkg" ${{ secrets.NUGET_APIKEY }} -source https://api.nuget.org/v3/index.json
run: nuget push "Telnet.$Env:NuGetVersionV2ext.nupkg" ${{ secrets.NUGET_APIKEY }} -source https://api.nuget.org/v3/index.json

- name: Setup Git User
uses: fregante/setup-git-user@v1.1.0
Expand Down

0 comments on commit dd8341b

Please sign in to comment.