-
Notifications
You must be signed in to change notification settings - Fork 36
199 lines (165 loc) · 5.98 KB
/
Copy pathrelease-appimage.yaml
File metadata and controls
199 lines (165 loc) · 5.98 KB
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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
name: Release AppImage
on:
workflow_dispatch: # Allows manual triggering
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+' # Push events to matching semantic version tags, i.e. 0.1.2, 1.0.0
jobs:
build-appimage:
runs-on: ubuntu-22.04
permissions:
contents: write
packages: read
steps:
- uses: actions/checkout@v6
- name: Cache apt packages
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: git cmake # do not include liblz4-dev libzstd-dev
version: 2.0
- name: Configure
run: cmake cloudini_lib -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_TESTING=OFF -DCLOUDINI_BUILD_BENCHMARKS=OFF
- name: Build
run: make -j$(nproc) install DESTDIR=AppDir
- name: Download linuxdeploy
run: |
wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
chmod +x linuxdeploy-x86_64.AppImage
- name: Get version
id: get_version
run: |
if [ "${{ github.event_name }}" = "push" ]; then
echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
else
echo "VERSION=latest" >> $GITHUB_OUTPUT
fi
- name: Create AppImage
env:
VERSION: ${{ steps.get_version.outputs.VERSION }}
run: |
./linuxdeploy-x86_64.AppImage --appdir AppDir --executable AppDir/usr/bin/cloudini_rosbag_converter -d cloudini_lib/tools/cloudini_converter.desktop -i cloudini.png --output appimage
- name: Upload AppImage artifact
uses: actions/upload-artifact@v7
with:
name: appimage-artifact
path: cloudini_rosbag_converter-*.AppImage
build-wasm:
runs-on: ubuntu-22.04
permissions:
contents: write
steps:
- uses: actions/checkout@v6
- name: Setup Emscripten cache
id: cache-emsdk
uses: actions/cache@v5
with:
path: emsdk
key: emsdk-3.1.51-${{ runner.os }}
- name: Setup Emscripten
if: steps.cache-emsdk.outputs.cache-hit != 'true'
run: |
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
./emsdk install 3.1.51
./emsdk activate 3.1.51
- name: Get version
id: get_version
run: |
if [ "${{ github.event_name }}" = "push" ]; then
echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
else
echo "VERSION=latest" >> $GITHUB_OUTPUT
fi
- name: Configure WASM build
run: |
source emsdk/emsdk_env.sh
cmake -B build_wasm -S cloudini_lib \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_TOOLCHAIN_FILE=$EMSDK/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake \
-DBUILD_TESTING=OFF \
-DCLOUDINI_BUILD_BENCHMARKS=OFF
- name: Build WASM modules
run: |
source emsdk/emsdk_env.sh
cmake --build build_wasm --target cloudini_wasm --parallel
cmake --build build_wasm --target cloudini_wasm_single --parallel
- name: Package WASM artifacts
run: |
mkdir -p wasm-release
cp build_wasm/cloudini_wasm.wasm wasm-release/
cp build_wasm/cloudini_wasm.js wasm-release/
cp build_wasm/cloudini_wasm_single.js wasm-release/
cd wasm-release
zip -r ../cloudini-wasm-${{ steps.get_version.outputs.VERSION }}.zip .
- name: Upload WASM artifact
uses: actions/upload-artifact@v7
with:
name: wasm-artifact
path: cloudini-wasm-*.zip
build-foxglove:
needs: build-wasm # Must wait for WASM to be built first
runs-on: ubuntu-22.04
permissions:
contents: write
steps:
- uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '20'
- name: Get version
id: get_version
run: |
if [ "${{ github.event_name }}" = "push" ]; then
echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
else
echo "VERSION=latest" >> $GITHUB_OUTPUT
fi
- name: Download WASM artifact
uses: actions/download-artifact@v8
with:
name: wasm-artifact
- name: Extract and copy WASM file to Foxglove src
run: |
unzip cloudini-wasm-${{ steps.get_version.outputs.VERSION }}.zip -d wasm-files
cp wasm-files/cloudini_wasm_single.js cloudini_foxglove/src/
ls -la cloudini_foxglove/src/
- name: Install dependencies
working-directory: cloudini_foxglove
run: npm ci
- name: Build Foxglove extension
working-directory: cloudini_foxglove
run: npm run build
- name: Package Foxglove extension
run: |
cd cloudini_foxglove/dist
zip -r ../../cloudini-foxglove-${{ steps.get_version.outputs.VERSION }}.zip .
- name: Upload Foxglove artifact
uses: actions/upload-artifact@v7
with:
name: foxglove-artifact
path: cloudini-foxglove-*.zip
create-release:
needs: [build-appimage, build-wasm, build-foxglove]
runs-on: ubuntu-22.04
if: github.event_name == 'push' # Only create release for tag pushes
permissions:
contents: write
steps:
- name: Get version
id: get_version
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- name: Download all artifacts
uses: actions/download-artifact@v8
- name: Display artifact structure
run: ls -R
- name: Create Release
uses: softprops/action-gh-release@v2
with:
name: Release ${{ steps.get_version.outputs.VERSION }}
files: |
appimage-artifact/cloudini_rosbag_converter-*.AppImage
wasm-artifact/cloudini-wasm-*.zip
foxglove-artifact/cloudini-foxglove-*.zip
draft: false
prerelease: false