Skip to content

Commit

Permalink
native package name, tests
Browse files Browse the repository at this point in the history
  • Loading branch information
galabovaa committed Mar 26, 2024
1 parent 7320c8a commit d964141
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 31 deletions.
28 changes: 14 additions & 14 deletions .github/workflows/build-nuget-package.yml
Expand Up @@ -30,7 +30,7 @@ jobs:
- uses: actions/upload-artifact@v4
with:
name: macos-x64
path: ${{runner.workspace}}/build/dotnet/Highs.Native/runtimes
path: ${{runner.workspace}}/build/dotnet/Highs/runtimes

# macos 14 is M1 (beta)
build_macos_14:
Expand All @@ -52,7 +52,7 @@ jobs:
- uses: actions/upload-artifact@v4
with:
name: macos-arm64
path: ${{runner.workspace}}/build/dotnet/Highs.Native/runtimes
path: ${{runner.workspace}}/build/dotnet/Highs/runtimes

# Build windows 32 and linux
build_windows_32:
Expand All @@ -76,7 +76,7 @@ jobs:
- uses: actions/upload-artifact@v4
with:
name: win-x32
path: ${{runner.workspace}}/build32/dotnet/Highs.Native/runtimes/win-x64/
path: ${{runner.workspace}}/build32/dotnet/Highs/runtimes/win-x64/

build_linux:
runs-on: ubuntu-latest
Expand All @@ -97,7 +97,7 @@ jobs:
- uses: actions/upload-artifact@v4
with:
name: linux-x64
path: ${{runner.workspace}}/build/dotnet/Highs.Native/runtimes
path: ${{runner.workspace}}/build/dotnet/Highs/runtimes

build_linux_arm64:
runs-on: ubuntu-latest
Expand All @@ -120,7 +120,7 @@ jobs:
- uses: actions/upload-artifact@v4
with:
name: linux-arm64
path: ${{runner.workspace}}/build_linux_arm64/dotnet/Highs.Native/runtimes
path: ${{runner.workspace}}/build_linux_arm64/dotnet/Highs/runtimes

build_windows:
runs-on: windows-latest
Expand All @@ -144,53 +144,53 @@ jobs:
- name: Display structure of downloaded files
run: |
pwd
ls -R ${{runner.workspace}}/build/dotnet/Highs.Native/runtimes
ls -R ${{runner.workspace}}/build/dotnet/Highs/runtimes
- name: Download runtimes macos-x64
uses: actions/download-artifact@v4
with:
name: macos-x64
path: ${{runner.workspace}}/build/dotnet/Highs.Native/runtimes
path: ${{runner.workspace}}/build/dotnet/Highs/runtimes

- name: Download runtimes macos-arm64
uses: actions/download-artifact@v4
with:
name: macos-arm64
path: ${{runner.workspace}}/build/dotnet/Highs.Native/runtimes
path: ${{runner.workspace}}/build/dotnet/Highs/runtimes

- name: Download runtimes win-x32
uses: actions/download-artifact@v4
with:
name: win-x32
path: ${{runner.workspace}}/build/dotnet/Highs.Native/runtimes/win-x32
path: ${{runner.workspace}}/build/dotnet/Highs/runtimes/win-x32

- name: Download runtimes
uses: actions/download-artifact@v4
with:
name: linux-x64
path: ${{runner.workspace}}/build/dotnet/Highs.Native/runtimes
path: ${{runner.workspace}}/build/dotnet/Highs/runtimes

- name: Download runtimes
uses: actions/download-artifact@v4
with:
name: linux-arm64
path: ${{runner.workspace}}/build/dotnet/Highs.Native/runtimes
path: ${{runner.workspace}}/build/dotnet/Highs/runtimes

- name: Display structure of downloaded files
run: ls -R ${{runner.workspace}}/build/dotnet/Highs.Native/runtimes
run: ls -R ${{runner.workspace}}/build/dotnet/Highs/runtimes

- uses: actions/setup-dotnet@v4
with:
dotnet-version: '2.1.x'

- name: Dotnet pack
working-directory: ${{runner.workspace}}/build/dotnet/Highs.Native
working-directory: ${{runner.workspace}}/build/dotnet/Highs
run: dotnet pack -c Release

- uses: actions/upload-artifact@v4
with:
name: nuget
path: ${{runner.workspace}}/build/dotnet/Highs.Native/bin/Release/*.nupkg
path: ${{runner.workspace}}/build/dotnet/Highs/bin/Release/*.nupkg

dotnet_push:
runs-on: windows-latest
Expand Down
25 changes: 12 additions & 13 deletions .github/workflows/test-nuget-package.yml
Expand Up @@ -34,14 +34,14 @@ jobs:
dotnet-version: '2.1.x'

- name: Dotnet pack
working-directory: ${{runner.workspace}}/build/dotnet/Highs.Native
working-directory: ${{runner.workspace}}/build/dotnet/Highs
run: dotnet pack -c Release

- name: Add local feed
run: dotnet nuget add source ${{runner.workspace}}/nugets

- name: Dotnet push to local feed
working-directory: ${{runner.workspace}}/build/dotnet/Highs.Native
working-directory: ${{runner.workspace}}/build/dotnet/Highs
run: dotnet nuget push ./bin/Release/*.nupkg -s ${{runner.workspace}}/nugets

- name: Create new project and test
Expand All @@ -51,7 +51,7 @@ jobs:
dotnet new console
rm Program.cs
cp $GITHUB_WORKSPACE/examples/call_highs_from_csharp.cs .
dotnet add package Highs.Native -s ${{runner.workspace}}/nugets
dotnet add package Highs -s ${{runner.workspace}}/nugets
Expand All @@ -77,14 +77,14 @@ jobs:
dotnet-version: '2.1.x'

- name: Dotnet pack
working-directory: ${{runner.workspace}}/build/dotnet/Highs.Native
working-directory: ${{runner.workspace}}/build/dotnet/Highs
run: dotnet pack -c Release

- name: Add local feed
run: dotnet nuget add source ${{runner.workspace}}/nugets

- name: Dotnet push to local feed
working-directory: ${{runner.workspace}}/build/dotnet/Highs.Native
working-directory: ${{runner.workspace}}/build/dotnet/Highs
run: dotnet nuget push ./bin/Release/*.nupkg -s ${{runner.workspace}}/nugets

- name: Create new project and test
Expand All @@ -94,7 +94,7 @@ jobs:
dotnet new console
rm Program.cs
cp $GITHUB_WORKSPACE/examples/call_highs_from_csharp.cs .
dotnet add package Highs.Native -s ${{runner.workspace}}/nugets
dotnet add package Highs -s ${{runner.workspace}}/nugets
build_linux:
runs-on: ubuntu-latest
Expand All @@ -117,14 +117,14 @@ jobs:
dotnet-version: '2.1.x'

- name: Dotnet pack
working-directory: ${{runner.workspace}}/build/dotnet/Highs.Native
working-directory: ${{runner.workspace}}/build/dotnet/Highs
run: dotnet pack -c Release

- name: Add local feed
run: dotnet nuget add source ${{runner.workspace}}/nugets

- name: Dotnet push to local feed
working-directory: ${{runner.workspace}}/build/dotnet/Highs.Native
working-directory: ${{runner.workspace}}/build/dotnet/Highs
run: dotnet nuget push ./bin/Release/*.nupkg -s ${{runner.workspace}}/nugets

- name: Create new project and test
Expand All @@ -134,11 +134,10 @@ jobs:
dotnet new console
rm Program.cs
cp $GITHUB_WORKSPACE/examples/call_highs_from_csharp.cs .
dotnet add package Highs.Native -s ${{runner.workspace}}/nugets
dotnet add package Highs -s ${{runner.workspace}}/nugets
build_windows:
runs-on: windows-latest
needs: [build_macos_12, build_macos_14, build_windows_32, build_linux, build_linux_arm64]
steps:
- uses: actions/checkout@v4
- name: Build HiGHS Windows native
Expand All @@ -160,14 +159,14 @@ jobs:
dotnet-version: '2.1.x'

- name: Dotnet pack
working-directory: ${{runner.workspace}}/build/dotnet/Highs.Native
working-directory: ${{runner.workspace}}/build/dotnet/Highs
run: dotnet pack -c Release

- name: Add local feed
run: dotnet nuget add source ${{runner.workspace}}/nugets

- name: Dotnet push to local feed
working-directory: ${{runner.workspace}}/build/dotnet/Highs.Native
working-directory: ${{runner.workspace}}/build/dotnet/Highs
run: dotnet nuget push ./bin/Release/*.nupkg -s ${{runner.workspace}}/nugets

- name: Create new project and test
Expand All @@ -177,4 +176,4 @@ jobs:
dotnet new console
rm Program.cs
cp $GITHUB_WORKSPACE/examples/call_highs_from_csharp.cs .
dotnet add package Highs.Native -s ${{runner.workspace}}/nugets
dotnet add package Highs-s ${{runner.workspace}}/nugets
4 changes: 2 additions & 2 deletions cmake/dotnet.cmake
Expand Up @@ -14,7 +14,7 @@ endif()
# message(STATUS "Found dotnet Program: ${DOTNET_EXECUTABLE}")
# endif()

set(DOTNET_PACKAGE Highs.Native)
set(DOTNET_PACKAGE Highs)
set(DOTNET_PACKAGES_DIR "${PROJECT_BINARY_DIR}/dotnet")

# Runtime IDentifier
Expand Down Expand Up @@ -119,7 +119,7 @@ file(MAKE_DIRECTORY ${DOTNET_PACKAGES_DIR})
# CMake variable(s) (@PROJECT_NAME@) that configure_file() can manage and
# generator expression ($<TARGET_FILE:...>) that file(GENERATE) can manage.
configure_file(
${PROJECT_SOURCE_DIR}/nuget/Highs.Native.csproj.in
${PROJECT_SOURCE_DIR}/nuget/Highs.csproj.in
${DOTNET_PROJECT_DIR}/${DOTNET_PROJECT}.csproj
@ONLY)

Expand Down
2 changes: 1 addition & 1 deletion nuget/Highs.Native.csproj.in → nuget/Highs.csproj.in
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<PackageId>Highs.Native</PackageId>
<PackageId>Highs</PackageId>
<Version>@PROJECT_VERSION@</Version>


Expand Down
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Expand Up @@ -307,7 +307,7 @@ else()
endif()
message(STATUS ".Net RID: ${DOTNET_RID}")

set(DOTNET_PROJECT Highs.Native)
set(DOTNET_PROJECT Highs)
set(DOTNET_PROJECT_DIR ${PROJECT_BINARY_DIR}/dotnet/${DOTNET_PROJECT})
file(MAKE_DIRECTORY ${DOTNET_PROJECT_DIR}/runtimes/${DOTNET_RID}/native)
add_custom_command(TARGET highs POST_BUILD
Expand Down

0 comments on commit d964141

Please sign in to comment.