Skip to content

Instantly share code, notes, and snippets.

@uselessgoddess
Created January 18, 2022 18:13
Show Gist options
  • Save uselessgoddess/54e286dbda22935313615d65723e7670 to your computer and use it in GitHub Desktop.
Save uselessgoddess/54e286dbda22935313615d65723e7670 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -e # Exit with nonzero exit code if anything fails
sudo apt-get install nuget
CPP_PACKAGE_NUSPEC_PATH=$(<CPP_PACKAGE_NUSPEC_PATH.txt)
CPP_PACKAGE_NUSPEC_DIRECTORY=$(dirname "$CPP_PACKAGE_NUSPEC_PATH")
CPP_PACKAGE_VERSION=$(<CPP_PACKAGE_VERSION.txt)
# Download icon.png for the package
wget -O "$CPP_PACKAGE_NUSPEC_DIRECTORY/icon.png" https://raw.githubusercontent.com/linksplatform/Documentation/18469f4d033ee9a5b7b84caab9c585acab2ac519/doc/Avatar-rainbow-icon-64x64.png
# Download TemplateLibrary.targets for the package
wget -O "$CPP_PACKAGE_NUSPEC_DIRECTORY/Platform.$REPOSITORY_NAME.TemplateLibrary.targets" https://raw.githubusercontent.com/linksplatform/Files/ed0dc702f52d56d80ea2f19c93df5cf2fdcbccbf/TemplateLibrary.targets
# Pack NuGet package
nuget pack "$CPP_PACKAGE_NUSPEC_PATH"
# Push NuGet package
nuget push ./**/*.nupkg -NoSymbols -SkipDuplicate -Source https://api.nuget.org/v3/index.json -ApiKey "${NUGETTOKEN}"
# Clean up
find . -type f -name '*.nupkg' -delete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment