Skip to content

Commit

Permalink
Create jar file from CI (#29)
Browse files Browse the repository at this point in the history
Signed-off-by: Geoffroy Jamgotchian <[email protected]>
  • Loading branch information
geofjamg authored Nov 17, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 9a023ca commit 52e9b35
Showing 4 changed files with 43 additions and 65 deletions.
43 changes: 40 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -55,18 +55,55 @@ jobs:

- name: Configure CMake
shell: bash
run: cmake -DCMAKE_BUILD_TYPE=Release ${{ matrix.config.cmake_options }} -S $GITHUB_WORKSPACE -B $GITHUB_WORKSPACE/build-${{ matrix.config.name }}
run: cmake -DCMAKE_BUILD_TYPE=Release ${{ matrix.config.cmake_options }} -S $GITHUB_WORKSPACE -B $GITHUB_WORKSPACE/build

- name: Build
shell: bash
run: cmake --build $GITHUB_WORKSPACE/build-${{ matrix.config.name }} --parallel --config Release
run: cmake --build $GITHUB_WORKSPACE/build --parallel --config Release

- name: Test
shell: bash
run: mvn --batch-mode package

- name: Upload artifact
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.config.artifact_name }}
path: ${{ runner.workspace }}/powsybl-math-native/target/classes/natives/${{ matrix.config.artifact_path }}/${{ matrix.config.artifact_name }}

package:
name: Package libraries to JAR
runs-on: ubuntu-latest
needs: build

steps:
- name: Checkout sources
uses: actions/checkout@v3

- name: Download Linux library
uses: actions/download-artifact@v3
with:
name: libmath.so
path: target/classes/natives/linux_64/

- name: Download MacOS library
uses: actions/download-artifact@v3
with:
name: libmath.dylib
path: target/classes/natives/osx_64/

- name: Download Windows library
uses: actions/download-artifact@v3
with:
name: math.dll
path: target/classes/natives/windows_64/

- name: Build Jar
shell: bash
run: mvn install

- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: powsybl-math-native.jar
path: target/*.jar
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -152,8 +152,8 @@ if(WIN32)
RUNTIME_OUTPUT_DIRECTORY_RELEASE "${CMAKE_CURRENT_SOURCE_DIR}/target/classes/natives/${ARCHITECTURE}"
)
set_target_properties(math
PROPERTIES
RUNTIME_OUTPUT_DIRECTORY_DEBUG "${CMAKE_CURRENT_SOURCE_DIR}/target/classes/natives/${ARCHITECTURE}"
PROPERTIES
RUNTIME_OUTPUT_DIRECTORY_DEBUG "${CMAKE_CURRENT_SOURCE_DIR}/target/classes/natives/${ARCHITECTURE}"
)
elseif(UNIX)
set_target_properties(math
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -5,8 +5,7 @@ This project is the C++ implementation of [powsybl-math](https://github.com/pows
To build `powsybl-math-native`, you need the following dependencies:
- [CMake](https://cmake.org/download)
- C++ compiler (gcc, clang or [Visual Studio](https://visualstudio.microsoft.com/fr/vs/features/cplusplus/))
- Java (8 or later)
- [Lapack](http://www.netlib.org/lapack/) & [Blas](http://www.netlib.org/blas/) libraries
- Java (11 or later)

## Compilation

58 changes: 0 additions & 58 deletions download-artifact.py

This file was deleted.

0 comments on commit 52e9b35

Please sign in to comment.