diff --git a/.github/workflows/test_auto.yml b/.github/workflows/test_auto.yml new file mode 100644 index 000000000..8568841a8 --- /dev/null +++ b/.github/workflows/test_auto.yml @@ -0,0 +1,16 @@ +name: Test Pull Request Auto CI + +on: + pull_request: + types: [ opened, synchronize, reopened ] + +jobs: + build: + name: Build + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Test Pull Request Auto CI + run: echo "Test Pull Request Auto CI" \ No newline at end of file diff --git a/.github/workflows/wasm_publish.yml b/.github/workflows/wasm_publish.yml index 7ca2d3ee4..b0ba75bda 100644 --- a/.github/workflows/wasm_publish.yml +++ b/.github/workflows/wasm_publish.yml @@ -7,13 +7,21 @@ on: description: 'Working directory (e.g., libs/client-api-wasm)' required: true default: 'libs/client-api-wasm' - package_name: - description: 'Package name' + which_package: + description: 'Which package to publish' required: true default: '@appflowyinc/client-api-wasm' + type: choice + options: + - '@appflowyinc/client-api-wasm' package_version: description: 'Package version' required: true + publish_args: + description: 'Publish arguments (e.g., --tag alpha)' + required: false + default: '' + env: NODE_VERSION: '20.12.0' RUST_TOOLCHAIN: "1.75" @@ -46,7 +54,7 @@ jobs: - name: Update package.json run: | cd ${{ github.event.inputs.working_directory }}/pkg - jq '.name = "${{ github.event.inputs.package_name }}" | .version = "${{ github.event.inputs.package_version }}"' package.json > package.json.tmp + jq '.name = "${{ github.event.inputs.which_package }}" | .version = "${{ github.event.inputs.package_version }}"' package.json > package.json.tmp mv package.json.tmp package.json - name: Configure npm for wasm-pack @@ -55,7 +63,7 @@ jobs: - name: Publish package run: | npm config set access public - wasm-pack publish + wasm-pack publish ${{ github.event.inputs.publish_args }} working-directory: ${{ github.event.inputs.working_directory }}/pkg env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/libs/client-api-wasm/Cargo.toml b/libs/client-api-wasm/Cargo.toml index c5fb6e796..c86aaeee4 100644 --- a/libs/client-api-wasm/Cargo.toml +++ b/libs/client-api-wasm/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Admin"] edition = "2018" [lib] -crate-type = ["cdylib", "rlib"] +crate-type = ["cdylib"] [features] @@ -36,5 +36,7 @@ uuid.workspace = true wasm-bindgen-test = "0.3.34" [profile.release] +panic = "abort" +lto = true # Tell `rustc` to optimize for small code size. opt-level = "s"