forked from Ivasoft/DllExports
44 lines
2.2 KiB
YAML
44 lines
2.2 KiB
YAML
kind: pipeline
|
|
name: default
|
|
|
|
steps:
|
|
- name: build
|
|
image: mcr.microsoft.com/dotnet/sdk:9.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
|
|
- apt update && apt install -y zip unzip
|
|
- unzip -d DllExports.MSBuild/bin/Release/nupkg DllExports.MSBuild/bin/Release/IvDllExports.0.1.1.2.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.2.nupkg
|
|
- (cd DllExports.MSBuild/bin/Release/nupkg; zip -r ../IvDllExports.0.1.1.2.nupkg ./)
|
|
# Cli
|
|
- dotnet build --configuration Release DllExports.Cli/DllExports.Cli.csproj
|
|
- dotnet pack --configuration Release DllExports.Cli/DllExports.Cli.csproj
|
|
|
|
- name: release
|
|
image: mcr.microsoft.com/dotnet/sdk:9.0
|
|
settings:
|
|
nuget_apikey:
|
|
from_secret: drone_release
|
|
nuget_uri: https://git.ivasoft.cz/api/packages/SW/nuget/index.json
|
|
commands:
|
|
- dotnet nuget push DllExports.MSBuild/bin/Release/IvDllExports.0.1.1.2.nupkg --api-key $$PLUGIN_NUGET_APIKEY --source $$PLUGIN_NUGET_URI --skip-duplicate
|
|
- dotnet nuget push DllExports.Cli/bin/Release/IvDllExports-Cli.0.1.1.2.nupkg --api-key $$PLUGIN_NUGET_APIKEY --source $$PLUGIN_NUGET_URI --skip-duplicate
|
|
when:
|
|
event: tag
|