forked from Ivasoft/DllExports
38 lines
1.8 KiB
YAML
38 lines
1.8 KiB
YAML
kind: pipeline
|
|
name: default
|
|
|
|
steps:
|
|
- name: build
|
|
image: mcr.microsoft.com/dotnet/sdk:8.0
|
|
settings:
|
|
nuget_apikey:
|
|
from_secret: drone_release
|
|
nuget_uri: https://git.ivasoft.cz/api/packages/Ivasoft/nuget/index.json
|
|
commands:
|
|
- dotnet build --configuration Release DllExports/DllExports.csproj
|
|
- dotnet build --configuration Release DllExports.MSBuild/DllExports.MSBuild.csproj
|
|
- dotnet pack --configuration Release DllExports.MSBuild/DllExports.MSBuild.csproj
|
|
## Following is based on build.ps1
|
|
- unzip -d DllExports.MSBuild/bin/Release/nupkg DllExports.MSBuild/bin/Release/IvDllExports.0.1.1.nupkg
|
|
- cp -r DllExports.MSBuild/bin/Release/nupkg/lib DllExports.MSBuild/bin/Release/nupkg/tasks
|
|
- find DllExports.MSBuild/bin/Release/nupkg/lib ! -name 'DllExports.dll' -type f -exec rm -f {} +
|
|
# Tasks are not supported on netstandard2.0
|
|
- rm -rf DllExports.MSBuild/bin/Release/nupkg/tasks/netstandard2.0
|
|
# We don't need libs for net472 and net5.0
|
|
- rm -rf DllExports.MSBuild/bin/Release/nupkg/lib/net472
|
|
- rm -rf DllExports.MSBuild/bin/Release/nupkg/lib/net5.0
|
|
- sed -i -E '/(NETFramework4.7.2|net5.0)/d' DllExports.MSBuild/bin/Release/nupkg/IvDllExports.nuspec
|
|
# Re-pack
|
|
- rm DllExports.MSBuild/bin/Release/IvDllExports.0.1.1.nupkg
|
|
- (cd DllExports.MSBuild/bin/Release/nupkg; zip -r ../IvDllExports.0.1.1.nupkg ./)
|
|
|
|
- name: release
|
|
image: mcr.microsoft.com/dotnet/sdk:8.0
|
|
settings:
|
|
nuget_apikey:
|
|
from_secret: drone_release
|
|
nuget_uri: https://git.ivasoft.cz/api/packages/Ivasoft/nuget/index.json
|
|
commands:
|
|
- dotnet nuget push DllExports.MSBuild/bin/Release/IvDllExports.0.1.1.nupkg --api-key $$PLUGIN_NUGET_APIKEY --source $$PLUGIN_NUGET_URI --skip-duplicate
|
|
when:
|
|
event: tag |