-
Notifications
You must be signed in to change notification settings - Fork 5
148 lines (121 loc) · 3.91 KB
/
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
name: CI
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
workflow_dispatch:
jobs:
build_win:
name: Build for Win64
strategy:
matrix:
sr_flag: ["ON", "OFF"]
runs-on: windows-2022
needs: compile_locales
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Locales
uses: actions/download-artifact@v4
with:
name: locales
path: ${{github.workspace}}/locales
- name: Configure
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Release -A x64 -DSIMRAIL=${{matrix.sr_flag}}
- name: Build
run: cmake --build ${{github.workspace}}/build --config Release
- name: Install
run: cmake --install ${{github.workspace}}/build --prefix ${{github.workspace}}/dist
- name: Publish
uses: actions/upload-artifact@v4
with:
name: build-win64-sr${{matrix.sr_flag}}
path: |
${{github.workspace}}/dist
build_wasm:
name: Build for WASM
strategy:
matrix:
sr_flag: ["ON", "OFF"]
verbose_flag: ["ON", "OFF"]
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Cache wasi-sdk
id: cache-wasi-sdk
uses: actions/cache@v4
with:
path: ${{github.workspace}}/wasi-sdk
key: wasi-sdk-20
- name: Download wasi-sdk
if: steps.cache-wasi-sdk.outputs.cache-hit != 'true'
run: |
mkdir -p ${{github.workspace}}/wasi-sdk
cd ${{github.workspace}}/wasi-sdk
export WASI_VERSION=20
export WASI_VERSION_FULL=${WASI_VERSION}.0
wget -nv https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${WASI_VERSION}/wasi-sdk-${WASI_VERSION_FULL}-linux.tar.gz
tar xf wasi-sdk-${WASI_VERSION_FULL}-linux.tar.gz --strip-components=1
- name: Configure
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Release -DSIMRAIL=${{matrix.sr_flag}} -DDEBUG_VERBOSE=${{matrix.verbose_flag}} -DWASI_HOST_EXE_SUFFIX= -DWASI_SDK_PREFIX=${{github.workspace}}/wasi-sdk -DCMAKE_TOOLCHAIN_FILE=${{github.workspace}}/utils/TC-wasi-sdk.cmake
- name: Build
run: cmake --build ${{github.workspace}}/build --config Release
- name: Publish
uses: actions/upload-artifact@v4
with:
name: build-wasm-sr${{matrix.sr_flag}}-verbose${{matrix.verbose_flag}}
path: |
${{github.workspace}}/build/DMI/dmi.wasm
${{github.workspace}}/build/EVC/evc.wasm
compile_locales:
name: Compile locales
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install gettext
run: |
sudo apt-get install -y gettext
- name: Compile
run: |
cd ${{github.workspace}}/locales
make
- name: Publish
uses: actions/upload-artifact@v4
with:
name: locales
path: |
${{github.workspace}}/locales/dmi/*.mo
${{github.workspace}}/locales/evc/*.mo
upload:
name: Create release and upload artifacts
needs:
- build_win
- build_wasm
runs-on: ubuntu-22.04
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
- name: Package artifacts
run: |
cd build-wasm-srON-verboseON/
zip -r ../ETCS-wasm.zip *
cd ..
cd build-win64-srOFF/
zip -r ../ETCS-windows.zip *
cd ..
- name: Install FUSE
run: sudo apt-get install -y fuse
- name: Create release and upload artifacts
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
wget -q https://github.com/TheAssassin/pyuploadtool/releases/download/continuous/pyuploadtool-x86_64.AppImage
chmod +x pyuploadtool-x86_64.AppImage
./pyuploadtool-x86_64.AppImage *.zip