From 48c634325908a4cfdbc571054b10c9e2e880f884 Mon Sep 17 00:00:00 2001 From: Kilu Date: Fri, 5 Apr 2024 18:34:15 +0800 Subject: [PATCH] chore: modified yml --- .github/workflows/test_auto.yml | 19 +++++++++++++++++++ .github/workflows/wasm_publish.yml | 16 ++++++++++++---- libs/client-api-wasm/Cargo.toml | 4 +++- 3 files changed, 34 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/test_auto.yml diff --git a/.github/workflows/test_auto.yml b/.github/workflows/test_auto.yml new file mode 100644 index 000000000..9631c859b --- /dev/null +++ b/.github/workflows/test_auto.yml @@ -0,0 +1,19 @@ +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 + - uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ env.RUST_TOOLCHAIN }} + + - 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"