-
Notifications
You must be signed in to change notification settings - Fork 0
149 lines (124 loc) · 4.93 KB
/
release-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
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: Upload release package
uses: softprops/action-gh-release@v2
with:
files: ./metrix-distribution/target/itools-metrix.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: softprops/action-gh-release@v2
with:
files: ${{ steps.metrix-install.outputs.archive_path }}.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
id: metrix-install
shell: powershell
run: |
$env:ARCHIVE_NAME = "metrix-simulator-windows"
$env:ARCHIVE_PATH = "$env:GITHUB_WORKSPACE\$env:ARCHIVE_NAME"
$env:ARCHIVE_PATH = $env:ARCHIVE_PATH -replace '\\','/'
echo "archive_name=$env:ARCHIVE_NAME"
echo "archive_path=$env:ARCHIVE_PATH"
cd $env:GITHUB_WORKSPACE/metrix-simulator/build/install
Compress-Archive -Path bin,etc -Destination $env:ARCHIVE_PATH
cd $env:GITHUB_WORKSPACE
dir
echo "archive_name=$env:ARCHIVE_NAME" >> "$env:GITHUB_OUTPUT"
echo "archive_path=$env:ARCHIVE_PATH" >> "$env:GITHUB_OUTPUT"
- name: Upload release package
uses: softprops/action-gh-release@v2
with:
files: ${{ steps.metrix-install.outputs.archive_path }}.zip