Map screen version
This commit is contained in:
+21
-3
@@ -34,10 +34,28 @@ commit=${GIT_COMMIT}
|
||||
built=${BUILD_DATE}
|
||||
EOF
|
||||
|
||||
# Cache-bust: give wasm/pck unique names so browsers never serve a stale build.
|
||||
# index.js gets a ?v= query string; wasm/pck get renamed because the engine
|
||||
# fetches them internally using GODOT_CONFIG.executable as the base name.
|
||||
STAMP="$GIT_COMMIT"
|
||||
cp "$BUILD_DIR/index.wasm" "$BUILD_DIR/index.${STAMP}.wasm"
|
||||
cp "$BUILD_DIR/index.wasm.gz" "$BUILD_DIR/index.${STAMP}.wasm.gz"
|
||||
cp "$BUILD_DIR/index.pck" "$BUILD_DIR/index.${STAMP}.pck"
|
||||
|
||||
sed -i \
|
||||
-e "s|src=\"index\.js\"|src=\"index.js?v=${STAMP}\"|" \
|
||||
-e "s|\"executable\":\"index\"|\"executable\":\"index.${STAMP}\"|" \
|
||||
-e "s|\"index\.pck\"|\"index.${STAMP}.pck\"|g" \
|
||||
-e "s|\"index\.wasm\"|\"index.${STAMP}.wasm\"|g" \
|
||||
"$BUILD_DIR/index.html"
|
||||
|
||||
# Remove previous build's versioned assets from the server before uploading.
|
||||
ssh "$SERVER_USER@$SERVER_HOST" "find $SERVER_PATH -maxdepth 1 -name 'index.*.wasm' -o -name 'index.*.wasm.gz' -o -name 'index.*.pck' | xargs -r rm -f"
|
||||
|
||||
scp "$BUILD_DIR/index.html" \
|
||||
"$BUILD_DIR/index.js" \
|
||||
"$BUILD_DIR/index.wasm.gz" \
|
||||
"$BUILD_DIR/index.pck" \
|
||||
"$BUILD_DIR/index.${STAMP}.wasm.gz" \
|
||||
"$BUILD_DIR/index.${STAMP}.pck" \
|
||||
"$BUILD_DIR/index.audio.worklet.js" \
|
||||
"$BUILD_DIR/index.audio.position.worklet.js" \
|
||||
"$BUILD_DIR/index.icon.png" \
|
||||
@@ -46,4 +64,4 @@ scp "$BUILD_DIR/index.html" \
|
||||
"$BUILD_DIR/version.txt" \
|
||||
"$SERVER_USER@$SERVER_HOST:$SERVER_PATH/"
|
||||
|
||||
echo "deployed ${VERSION} to $SERVER_HOST:$SERVER_PATH"
|
||||
echo "deployed ${VERSION} (${STAMP}) to $SERVER_HOST:$SERVER_PATH"
|
||||
|
||||
Reference in New Issue
Block a user