Skip to content

Commit e231e2a

Browse files
authored
Ruffle autodownload (#220)
- download latest release of Ruffle via yarn run update-ruffle - don't commit ruffle binaries - run update-ruffle as part of release
1 parent f2a68cf commit e231e2a

8 files changed

+21
-8
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,12 @@
5757
"start-electron": "NODE_ENV=development electron ./dist/electron/electron.js",
5858
"start-ext": "NODE_ENV=development webpack --mode=development --watch",
5959
"start-embed": "yarn run build-dev && cd dist/embed/ && http-server -p 10001",
60+
"update-ruffle": "./src/static/ruffle/download-latest-ruffle.sh",
6061
"pack": "CSC_IDENTITY_AUTO_DISCOVERY=false electron-builder --publish never",
6162
"pack-signed": "electron-builder",
6263
"dist": "yarn run build && yarn run pack",
6364
"dist-dev": "yarn run build-dev && yarn run pack",
64-
"release": "yarn run build && electron-builder",
65+
"release": "yarn run update-ruffle && yarn run build && electron-builder",
6566
"lint": "eslint ./src/ webpack.config.js"
6667
},
6768
"build": {

src/static/ruffle/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*.wasm
2+
*.js
-14.6 MB
Binary file not shown.
-14.9 MB
Binary file not shown.

src/static/ruffle/core.ruffle.2bdce3d13ee9db3415e5.js

Lines changed: 0 additions & 2 deletions
This file was deleted.

src/static/ruffle/core.ruffle.3cb02ac2f1dd5c9282e8.js

Lines changed: 0 additions & 2 deletions
This file was deleted.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
3+
4+
RUFFLE_DIR=$SCRIPT_DIR
5+
6+
SELFHOST_URL=$(curl "https://api.github.com/repos/ruffle-rs/ruffle/releases" | jq -r '.[0].assets[] | select(.name | contains("selfhosted")) | .browser_download_url')
7+
8+
echo "$SELFHOST_URL"
9+
10+
curl -L -o $RUFFLE_DIR/ruffle.zip "$SELFHOST_URL"
11+
12+
rm $RUFFLE_DIR/*.js $RUFFLE_DIR/*.wasm
13+
14+
cd $RUFFLE_DIR
15+
unzip $RUFFLE_DIR/ruffle.zip *.js *.wasm
16+
17+
rm $RUFFLE_DIR/ruffle.zip

src/static/ruffle/ruffle.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)