Skip to content

Commit

Permalink
Ruffle autodownload (#220)
Browse files Browse the repository at this point in the history
- download latest release of Ruffle via yarn run update-ruffle
- don't commit ruffle binaries
- run update-ruffle as part of release
  • Loading branch information
ikreymer authored Jun 4, 2024
1 parent f2a68cf commit e231e2a
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 8 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,12 @@
"start-electron": "NODE_ENV=development electron ./dist/electron/electron.js",
"start-ext": "NODE_ENV=development webpack --mode=development --watch",
"start-embed": "yarn run build-dev && cd dist/embed/ && http-server -p 10001",
"update-ruffle": "./src/static/ruffle/download-latest-ruffle.sh",
"pack": "CSC_IDENTITY_AUTO_DISCOVERY=false electron-builder --publish never",
"pack-signed": "electron-builder",
"dist": "yarn run build && yarn run pack",
"dist-dev": "yarn run build-dev && yarn run pack",
"release": "yarn run build && electron-builder",
"release": "yarn run update-ruffle && yarn run build && electron-builder",
"lint": "eslint ./src/ webpack.config.js"
},
"build": {
Expand Down
2 changes: 2 additions & 0 deletions src/static/ruffle/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.wasm
*.js
Binary file removed src/static/ruffle/35bdd3b1a72b1704b5f5.wasm
Binary file not shown.
Binary file removed src/static/ruffle/932a995f8efbc8932dcc.wasm
Binary file not shown.
2 changes: 0 additions & 2 deletions src/static/ruffle/core.ruffle.2bdce3d13ee9db3415e5.js

This file was deleted.

2 changes: 0 additions & 2 deletions src/static/ruffle/core.ruffle.3cb02ac2f1dd5c9282e8.js

This file was deleted.

17 changes: 17 additions & 0 deletions src/static/ruffle/download-latest-ruffle.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )

RUFFLE_DIR=$SCRIPT_DIR

SELFHOST_URL=$(curl "https://api.github.com/repos/ruffle-rs/ruffle/releases" | jq -r '.[0].assets[] | select(.name | contains("selfhosted")) | .browser_download_url')

echo "$SELFHOST_URL"

curl -L -o $RUFFLE_DIR/ruffle.zip "$SELFHOST_URL"

rm $RUFFLE_DIR/*.js $RUFFLE_DIR/*.wasm

cd $RUFFLE_DIR
unzip $RUFFLE_DIR/ruffle.zip *.js *.wasm

rm $RUFFLE_DIR/ruffle.zip
3 changes: 0 additions & 3 deletions src/static/ruffle/ruffle.js

This file was deleted.

0 comments on commit e231e2a

Please sign in to comment.