diff --git a/.github/workflows/deno.yml b/.github/workflows/deno.yml index 902893e..484c492 100644 --- a/.github/workflows/deno.yml +++ b/.github/workflows/deno.yml @@ -47,4 +47,13 @@ jobs: - name: Upload to B2 run: | ./b2 authorize-account ${{ secrets.CICD_CLI_B2_KEY_ID }} ${{ secrets.CICD_CLI_B2_APPLICATION_KEY }} - ./b2 sync --compareVersions size --delete wasm/pkg/ b2://${{ secrets.CICD_CLI_B2_BUCKET_NAME }}/minify-html/deno/${{ steps.version.outputs.VERSION }}/ + for f in wasm/pkg/*; do; + if [[ "$f" == *.js ]]; then + content_type='application/json' + elif [[ "$f" == *.wasm ]]; then + content_type='application/wasm' + else + content_type='application/octet-stream' + fi + ./b2 upload-file --contentType "$content_type" ${{ secrets.CICD_CLI_B2_BUCKET_NAME }} "$f" "minify-html/deno/${{ steps.version.outputs.VERSION }}/$(basename "$f")" + done diff --git a/wasm/build b/wasm/build index 0d0f3ce..1e02ee3 100755 --- a/wasm/build +++ b/wasm/build @@ -12,7 +12,7 @@ pushd pkg # `bundler` is for WASM/npm, `web` is for Deno. if [[ "$target" = "bundler" ]]; then # Use -i.tmp to support macOS and Linux. - sed -i.tmp -E 's%"name": "index"%"name": "@minify-html/'$pkg_suffix'"%' package.json + sed -i.tmp -E 's%"name": "index"%"name": "@minify-html/wasm"%' package.json rm package.json.tmp .gitignore elif [[ "$target" = "web" ]]; then rm package.json .gitignore