-
Notifications
You must be signed in to change notification settings - Fork 1
76 lines (61 loc) · 1.85 KB
/
cross-compile.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
name: Cross-compile
on: [push, workflow_dispatch]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-20.04, windows-2019 ]
steps:
- uses: actions/checkout@v3
- name: "Configure and build (Linux)"
if: startsWith(runner.os, 'Linux')
run: |
cmake . -B build
cmake --build build
- name: "Configure and build (Windows)"
if: startsWith(runner.os, 'Windows')
run: |
cmake . -B build -A x64
cmake --build build --config Release
- name: "Read model name (Linux)"
run: |
echo "MODEL_PATH=$(cat build/model.txt)" >> $GITHUB_ENV
if: runner.os != 'Windows'
- name: "Read model name (Windows)"
run: |
echo "MODEL_PATH=$(cat build/model.txt)" | Out-File -FilePath $env:GITHUB_ENV -Append
if: runner.os == 'Windows'
- name: "Archive library"
uses: actions/upload-artifact@v3
with:
name: binaries
path: build/${{ env.MODEL_PATH }}/binaries
- name: "Archive modelDescription.xml"
if: startsWith(runner.os, 'Linux')
uses: actions/upload-artifact@v3
with:
name: modelDescription
path: build/${{ env.MODEL_PATH }}/modelDescription.xml
deploy:
needs: build
runs-on: ubuntu-22.04
steps:
- name: "Download binaries"
uses: actions/download-artifact@v3
with:
name: binaries
path: model/binaries
- name: "Download modelDescription.xml"
uses: actions/download-artifact@v3
with:
name: modelDescription
path: model
- name: "Set permissions"
run: |
sudo chmod -R +x model/binaries
- name: "Upload FMU"
uses: actions/upload-artifact@v3
with:
name: model
path: model