Unverified Commit e7edb6cb authored by Nikita Titov's avatar Nikita Titov Committed by GitHub
Browse files

[ci] restore nuget artifact creation (#6593)

* Update .vsts-ci.yml

* Update create-nuget.py

* Update .vsts-ci.yml

* Update .vsts-ci.yml
parent 8843703a
...@@ -8,20 +8,20 @@ from shutil import copyfile ...@@ -8,20 +8,20 @@ from shutil import copyfile
if __name__ == "__main__": if __name__ == "__main__":
source = Path(sys.argv[1]) source = Path(sys.argv[1])
current_dir = Path(__file__).absolute().parent nuget_dir = Path(__file__).absolute().parent / "nuget"
linux_folder_path = current_dir / "runtimes" / "linux-x64" / "native" linux_folder_path = nuget_dir / "runtimes" / "linux-x64" / "native"
linux_folder_path.mkdir(parents=True, exist_ok=True) linux_folder_path.mkdir(parents=True, exist_ok=True)
osx_folder_path = current_dir / "runtimes" / "osx-x64" / "native" osx_folder_path = nuget_dir / "runtimes" / "osx-x64" / "native"
osx_folder_path.mkdir(parents=True, exist_ok=True) osx_folder_path.mkdir(parents=True, exist_ok=True)
windows_folder_path = current_dir / "runtimes" / "win-x64" / "native" windows_folder_path = nuget_dir / "runtimes" / "win-x64" / "native"
windows_folder_path.mkdir(parents=True, exist_ok=True) windows_folder_path.mkdir(parents=True, exist_ok=True)
build_folder_path = current_dir / "build" build_folder_path = nuget_dir / "build"
build_folder_path.mkdir(parents=True, exist_ok=True) build_folder_path.mkdir(parents=True, exist_ok=True)
copyfile(source / "lib_lightgbm.so", linux_folder_path / "lib_lightgbm.so") copyfile(source / "lib_lightgbm.so", linux_folder_path / "lib_lightgbm.so")
copyfile(source / "lib_lightgbm.dylib", osx_folder_path / "lib_lightgbm.dylib") copyfile(source / "lib_lightgbm.dylib", osx_folder_path / "lib_lightgbm.dylib")
copyfile(source / "lib_lightgbm.dll", windows_folder_path / "lib_lightgbm.dll") copyfile(source / "lib_lightgbm.dll", windows_folder_path / "lib_lightgbm.dll")
copyfile(source / "lightgbm.exe", windows_folder_path / "lightgbm.exe") copyfile(source / "lightgbm.exe", windows_folder_path / "lightgbm.exe")
version = (current_dir.parent / "VERSION.txt").read_text(encoding="utf-8").strip().replace("rc", "-rc") version = (nuget_dir.parents[1] / "VERSION.txt").read_text(encoding="utf-8").strip().replace("rc", "-rc")
nuget_str = rf"""<?xml version="1.0"?> nuget_str = rf"""<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd"> <package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata> <metadata>
...@@ -76,6 +76,6 @@ if __name__ == "__main__": ...@@ -76,6 +76,6 @@ if __name__ == "__main__":
</Target> </Target>
</Project> </Project>
""" """
(current_dir / "LightGBM.nuspec").write_text(nuget_str, encoding="utf-8") (nuget_dir / "LightGBM.nuspec").write_text(nuget_str, encoding="utf-8")
(current_dir / "build" / "LightGBM.props").write_text(prop_str, encoding="utf-8") (nuget_dir / "build" / "LightGBM.props").write_text(prop_str, encoding="utf-8")
(current_dir / "build" / "LightGBM.targets").write_text(target_str, encoding="utf-8") (nuget_dir / "build" / "LightGBM.targets").write_text(target_str, encoding="utf-8")
...@@ -424,7 +424,7 @@ jobs: ...@@ -424,7 +424,7 @@ jobs:
- task: NuGetCommand@2 - task: NuGetCommand@2
inputs: inputs:
command: pack command: pack
packagesToPack: '$(Build.SourcesDirectory)/.nuget/*.nuspec' packagesToPack: '$(Build.SourcesDirectory)/.ci/nuget/*.nuspec'
packDestination: '$(Build.ArtifactStagingDirectory)/nuget' packDestination: '$(Build.ArtifactStagingDirectory)/nuget'
- task: PublishBuildArtifacts@1 - task: PublishBuildArtifacts@1
inputs: inputs:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment