-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Damien Jeandemange <[email protected]>
- Loading branch information
0 parents
commit 9491b01
Showing
2 changed files
with
164 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,161 @@ | ||
name: Release CI | ||
|
||
on: | ||
release: | ||
types: | ||
- created | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
java: | ||
name: Package Java | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '17' | ||
|
||
- name: Checkout sources | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: powsybl/powsybl-metrix | ||
ref: refs/heads/windows-ci | ||
|
||
- name: Package with Maven | ||
run: ./mvnw --batch-mode package | ||
|
||
- name: Get Maven version | ||
run: echo "MAVEN_PROJECT_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV | ||
|
||
- name: Upload release package | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ github.event.release.upload_url }} | ||
asset_path: ./metrix-distribution/target/itools-metrix.zip | ||
asset_name: itools-metrix-${{ env.MAVEN_PROJECT_VERSION }}.zip | ||
asset_content_type: application/zip | ||
|
||
cpp_ubuntu: | ||
name: Package C++ Ubuntu | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Install Boost | ||
run: | | ||
sudo apt-get update -y | ||
sudo apt-get install -y libboost-all-dev | ||
- name: Checkout sources | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: powsybl/powsybl-metrix | ||
ref: refs/heads/windows-ci | ||
|
||
- name: Configure 3rd parties | ||
run: > | ||
cmake -S $GITHUB_WORKSPACE/metrix-simulator/external -B $GITHUB_WORKSPACE/metrix-simulator/build/external | ||
- name: Build 3rd parties | ||
run: > | ||
cmake --build $GITHUB_WORKSPACE/metrix-simulator/build/external --parallel 2 | ||
- name: Configure CMake | ||
run: > | ||
cmake -Wno-dev -S $GITHUB_WORKSPACE/metrix-simulator -B $GITHUB_WORKSPACE/metrix-simulator/build | ||
-DCMAKE_BUILD_TYPE=Release | ||
-DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/metrix-simulator/build/install | ||
- name: Build | ||
run: cmake --build $GITHUB_WORKSPACE/metrix-simulator/build --target install --parallel 2 | ||
|
||
# - name: Tests | ||
# run: cd $GITHUB_WORKSPACE/metrix-simulator/build && ctest -j2 --output-on-failure | ||
|
||
- name: Prepare Metrix package | ||
id: metrix-install | ||
run: | | ||
ARCHIVE_NAME="metrix-simulator-ubuntu" | ||
ARCHIVE_PATH="$PWD/${ARCHIVE_NAME}" | ||
cd metrix-simulator/build/install/ | ||
zip -r $ARCHIVE_PATH bin etc | ||
echo "archive_name=$ARCHIVE_NAME" >> "$GITHUB_OUTPUT" | ||
echo "archive_path=$ARCHIVE_PATH" >> "$GITHUB_OUTPUT" | ||
- name: Upload release package | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ github.event.release.upload_url }} | ||
asset_path: ${{ steps.metrix-install.outputs.archive_path }}.zip | ||
asset_name: ${{ steps.metrix-install.outputs.archive_name }}.zip | ||
asset_content_type: application/zip | ||
|
||
cpp_windows: | ||
name: Package C++ Windows | ||
runs-on: windows-latest | ||
defaults: | ||
run: | ||
shell: cmd | ||
env: | ||
BOOST_ROOT: C:\thirdparties\boost-1.72.0 | ||
BOOST_URL: https://sourceforge.net/projects/boost/files/boost-binaries/1.72.0/boost_1_72_0-msvc-14.2-64.exe/download | ||
steps: | ||
- name: Install Boost | ||
run: | | ||
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" | ||
choco install wget --no-progress | ||
wget -nv -O boost-installer.exe %BOOST_URL% | ||
boost-installer.exe /dir=%BOOST_ROOT% /sp- /verysilent /suppressmsgboxes /norestart | ||
- name: Checkout sources | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: powsybl/powsybl-metrix | ||
ref: refs/heads/windows-ci | ||
|
||
- name: Configure 3rd parties | ||
run: > | ||
cmake -S %GITHUB_WORKSPACE%\metrix-simulator\external -B %GITHUB_WORKSPACE%\metrix-simulator\build\external | ||
- name: Build 3rd parties | ||
run: > | ||
cmake --build %GITHUB_WORKSPACE%\metrix-simulator\build\external --parallel 2 --config Release | ||
- name: Configure CMake | ||
run: > | ||
cmake -Wno-dev -S %GITHUB_WORKSPACE%\metrix-simulator -B %GITHUB_WORKSPACE%\metrix-simulator\build | ||
-DCMAKE_BUILD_TYPE=Release | ||
-DCMAKE_INSTALL_PREFIX=%GITHUB_WORKSPACE%\metrix-simulator\build\install | ||
- name: Build | ||
run: cmake --build %GITHUB_WORKSPACE%\metrix-simulator\build --target install --parallel 2 --config Release | ||
|
||
# - name: Tests | ||
# run: cd %GITHUB_WORKSPACE%\metrix-simulator\build && ctest -j2 --output-on-failure -C Release | ||
|
||
- name: Prepare Metrix package | ||
shell: powershell | ||
run: | | ||
$env:ARCHIVE_NAME = "metrix-simulator-windows" | ||
$env:ARCHIVE_PATH = "$env:GITHUB_WORKSPACE\$env:ARCHIVE_NAME" | ||
cd $env:GITHUB_WORKSPACE/metrix-simulator/build/install | ||
Compress-Archive -Path bin,etc -Destination $env:ARCHIVE_PATH | ||
echo "archive_name=$env:ARCHIVE_NAME" >> "$GITHUB_OUTPUT" | ||
echo "archive_path=$env:ARCHIVE_PATH" >> "$GITHUB_OUTPUT" | ||
- name: Upload release package | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ github.event.release.upload_url }} | ||
asset_path: ${{ steps.metrix-install.outputs.archive_path }}.zip | ||
asset_name: ${{ steps.metrix-install.outputs.archive_name }}.zip | ||
asset_content_type: application/zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# About | ||
|
||
Build of [powsybl-metrix](https://github.com/powsybl/powsybl-metrix) - temporary meanwhile binary releases related PRs are accepted on powsybl-metrix side. |