Skip to content

Commit 60e7354

Browse files
authored
Cleaning up.
2 parents 5401f5f + df384f2 commit 60e7354

File tree

3 files changed

+20
-10
lines changed

3 files changed

+20
-10
lines changed

.github/workflows/cd.yml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ jobs:
197197
uses: pypa/gh-action-pypi-publish@release/v1
198198
webassembly:
199199
name: WebAssembly
200-
runs-on: macos-14
200+
runs-on: ubuntu-22.04
201201
env:
202202
BUILDCACHE_ACCURACY: STRICT
203203
BUILDCACHE_COMPRESS_FORMAT: ZSTD
@@ -208,7 +208,7 @@ jobs:
208208
- name: Set the timezone to New Zealand
209209
uses: szenius/set-timezone@v2.0
210210
with:
211-
timezoneMacos: 'Pacific/Auckland'
211+
timezoneLinux: 'Pacific/Auckland'
212212
- name: Check out libOpenCOR
213213
uses: actions/checkout@v4
214214
- name: Install CMake and Ninja
@@ -218,7 +218,7 @@ jobs:
218218
with:
219219
cache_key: cd-webassembly
220220
- name: Install Emscripten
221-
run: brew install emscripten
221+
uses: mymindstorm/setup-emsdk@v14
222222
- name: Configure libOpenCOR
223223
run: cmake -G Ninja -S . -B build -DBUILD_TYPE=Release -DCODE_ANALYSIS=OFF -DCODE_COVERAGE=OFF -DDOCUMENTATION=OFF -DJAVASCRIPT_BINDINGS=ON -DJAVASCRIPT_UNIT_TESTING=OFF -DMEMORY_CHECKS=OFF -DPYTHON_BINDINGS=OFF -DPYTHON_UNIT_TESTING=OFF -DSHARED_LIBS=OFF -DUNIT_TESTING=OFF
224224
- name: Build WebAssembly
@@ -228,12 +228,23 @@ jobs:
228228
uses: actions/upload-artifact@v4
229229
with:
230230
name: WebAssembly
231-
path: ./build/libopencor*
231+
path: ./build/libopencor-*
232232
- name: Release WebAssembly
233233
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
234234
uses: softprops/action-gh-release@v2
235235
with:
236-
files: ./build/libopencor*
236+
files: ./build/libopencor-*
237+
- name: Deploy to https://opencor.ws/libopencor/downloads/wasm
238+
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
239+
uses: milanmk/actions-file-deployer@master
240+
with:
241+
remote-protocol: sftp
242+
remote-host: ${{ secrets.REMOTE_HOST }}
243+
remote-user: ${{ secrets.REMOTE_USER }}
244+
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
245+
local-path: ./build/src/bindings/javascript/build/src/wasm
246+
remote-path: /home/www/opencor.ws/libopencor/downloads/wasm
247+
sync: full
237248
- name: Publish libOpenCOR
238249
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
239250
run: |

VERSION.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.20250924.4
1+
0.20250925.0

src/CMakeLists.txt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -297,13 +297,11 @@ if(EMSCRIPTEN)
297297

298298
# Package our JavaScript bindings, if possible.
299299

300-
set(CMAKE_MAIN_BINARY_DIR ${CMAKE_BINARY_DIR}/../../../..)
301-
302300
find_program(NPM_EXE NAMES ${PREFERRED_NPM_NAMES} npm)
303301

304302
if(NPM_EXE)
305303
set(TGZ_FILENAME ${REAL_CMAKE_PROJECT_NAME}-${PROJECT_VERSION}.tgz)
306-
set(TGZ_FILE ${CMAKE_MAIN_BINARY_DIR}/${TGZ_FILENAME})
304+
set(TGZ_FILE ${CMAKE_BINARY_DIR}/../../../../${TGZ_FILENAME})
307305

308306
add_custom_command(TARGET ${CMAKE_PROJECT_NAME} POST_BUILD
309307
COMMAND ${CMAKE_COMMAND} -E make_directory dist
@@ -318,8 +316,9 @@ if(EMSCRIPTEN)
318316
# Copy our generated .js file over so that it can be deployed.
319317

320318
add_custom_command(TARGET ${CMAKE_PROJECT_NAME} POST_BUILD
319+
COMMAND ${CMAKE_COMMAND} -E make_directory wasm
321320
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_PROJECT_NAME}.js
322-
${CMAKE_MAIN_BINARY_DIR}/${CMAKE_PROJECT_NAME}.js)
321+
wasm/${CMAKE_PROJECT_NAME}-${CMAKE_PROJECT_VERSION}.js)
323322

324323
# Copy our generated .js file over so that it can be used by our test Web page.
325324

0 commit comments

Comments
 (0)