Skip to content

Commit

Permalink
chore: modified yml
Browse files Browse the repository at this point in the history
  • Loading branch information
qinluhe committed Apr 5, 2024
1 parent 3bf5fb0 commit 48c6343
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 5 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/test_auto.yml
Original file line number Diff line number Diff line change
@@ -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"
16 changes: 12 additions & 4 deletions .github/workflows/wasm_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand All @@ -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 }}
4 changes: 3 additions & 1 deletion libs/client-api-wasm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ authors = ["Admin"]
edition = "2018"

[lib]
crate-type = ["cdylib", "rlib"]
crate-type = ["cdylib"]


[features]
Expand Down Expand Up @@ -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"

0 comments on commit 48c6343

Please sign in to comment.