diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3bf4354eda..0da5e86c90 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -178,35 +178,37 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@master - with: - toolchain: ${{ env.RUST_VERSION }} - targets: "wasm32-unknown-unknown" - - - name: Installing required crates - run: cargo install wasm-bindgen-cli wasm-opt - - - name: Setup PNPM - uses: pnpm/action-setup@v2 - with: - version: 8.6.9 - - - name: Setup Node - uses: actions/setup-node@v3 - with: - cache: "pnpm" - node-version: 18.14.1 - node-version-file: ".npm/package.json" - cache-dependency-path: ".npm/pnpm-lock.yaml" - - - name: Build and Test packages - run: | - pnpm -C .npm install - pnpm -C .npm all - - - name: Publish - run: | - npm whoami - pnpm -C .npm publish -r --tag --dry-run - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + - name: Debugging + run: .npm/.scripts/assemble-package.sh + # - uses: dtolnay/rust-toolchain@master + # with: + # toolchain: ${{ env.RUST_VERSION }} + # targets: "wasm32-unknown-unknown" + + # - name: Installing required crates + # run: cargo install wasm-bindgen-cli wasm-opt + + # - name: Setup PNPM + # uses: pnpm/action-setup@v2 + # with: + # version: 8.6.9 + + # - name: Setup Node + # uses: actions/setup-node@v3 + # with: + # cache: "pnpm" + # node-version: 18.14.1 + # node-version-file: ".npm/package.json" + # cache-dependency-path: ".npm/pnpm-lock.yaml" + + # - name: Build and Test packages + # run: | + # pnpm -C .npm install + # pnpm -C .npm all + + # - name: Publish + # run: | + # npm whoami + # pnpm -C .npm publish -r --tag --dry-run + # env: + # NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.npm/.scripts/assemble-packages.sh b/.npm/.scripts/assemble-packages.sh index f42354f441..098f4be0b4 100755 --- a/.npm/.scripts/assemble-packages.sh +++ b/.npm/.scripts/assemble-packages.sh @@ -33,28 +33,31 @@ build_wasm_npm_pkg_for () NAME_DASHED=$1 NAME_UNDERSCORED=$(echo "${NAME_DASHED}" | sed -r 's/-/_/g') - PKG_DIR=${PKGS_DIR}/${NAME_DASHED} + echo "NAME_DASHED=${NAME_DASHED}" + echo "NAME_UNDERSCORED=${NAME_UNDERSCORED}" + + # PKG_DIR=${PKGS_DIR}/${NAME_DASHED} - rm -rf ${PKG_DIR}/{src,dist} + # rm -rf ${PKG_DIR}/{src,dist} - cd ${ROOT_DIR} - cargo rustc -p ${NAME_DASHED} --target wasm32-unknown-unknown --features typescript --crate-type=cdylib --release - wasm-bindgen --target web ./target/wasm32-unknown-unknown/release/${NAME_UNDERSCORED}.wasm --out-dir ${PKG_DIR}/src - wasm-opt ${PKG_DIR}/src/${NAME_UNDERSCORED}_bg.wasm -o ${PKG_DIR}/src/${NAME_UNDERSCORED}_bg.wasm -Oz - cd ~- + # cd ${ROOT_DIR} + # cargo rustc -p ${NAME_DASHED} --target wasm32-unknown-unknown --features typescript --crate-type=cdylib --release + # wasm-bindgen --target web ./target/wasm32-unknown-unknown/release/${NAME_UNDERSCORED}.wasm --out-dir ${PKG_DIR}/src + # wasm-opt ${PKG_DIR}/src/${NAME_UNDERSCORED}_bg.wasm -o ${PKG_DIR}/src/${NAME_UNDERSCORED}_bg.wasm -Oz + # cd ~- - write_template ${NAME_DASHED} ${NAME_UNDERSCORED} README.md - write_template ${NAME_DASHED} ${NAME_UNDERSCORED} package.json - # write_template ${NAME_DASHED} ${NAME_UNDERSCORED} pnpm-lock.yaml - write_template ${NAME_DASHED} ${NAME_UNDERSCORED} rollup.config.mjs - write_template ${NAME_DASHED} ${NAME_UNDERSCORED} src/index.js + # write_template ${NAME_DASHED} ${NAME_UNDERSCORED} README.md + # write_template ${NAME_DASHED} ${NAME_UNDERSCORED} package.json + # # write_template ${NAME_DASHED} ${NAME_UNDERSCORED} pnpm-lock.yaml + # write_template ${NAME_DASHED} ${NAME_UNDERSCORED} rollup.config.mjs + # write_template ${NAME_DASHED} ${NAME_UNDERSCORED} src/index.js - # commenting out all `new URL()` and `fetch()` calls for great compatibility with JS bundlers - sed -i.bkp -r 's;(input = new URL.+);//\1;g' ${PKG_DIR}/src/${NAME_UNDERSCORED}.js - sed -i.bkp -r 's;(input = fetch.+);//\1;g' ${PKG_DIR}/src/${NAME_UNDERSCORED}.js - rm ${PKG_DIR}/src/${NAME_UNDERSCORED}.js.bkp + # # commenting out all `new URL()` and `fetch()` calls for great compatibility with JS bundlers + # sed -i.bkp -r 's;(input = new URL.+);//\1;g' ${PKG_DIR}/src/${NAME_UNDERSCORED}.js + # sed -i.bkp -r 's;(input = fetch.+);//\1;g' ${PKG_DIR}/src/${NAME_UNDERSCORED}.js + # rm ${PKG_DIR}/src/${NAME_UNDERSCORED}.js.bkp } build_wasm_npm_pkg_for "fuel-asm" -build_wasm_npm_pkg_for "fuel-types" +# build_wasm_npm_pkg_for "fuel-types"