Merge pull request #877 from loro-dev/release-rust #462
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release WASM | |
| on: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: write | |
| id-token: write | |
| pull-requests: write | |
| jobs: | |
| release: | |
| name: Release | |
| runs-on: macos-14 | |
| steps: | |
| - name: Checkout Repo | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10 | |
| - name: Setup node | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| cache: pnpm | |
| registry-url: "https://registry.npmjs.org" | |
| - name: Upgrade npm for trusted publishing | |
| run: | | |
| corepack enable | |
| corepack prepare npm@latest --activate | |
| npm --version | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v1 | |
| with: | |
| bun-version: 1.3.0 | |
| - name: Setup Deno | |
| uses: denoland/setup-deno@v1 | |
| with: | |
| deno-version: v2.x | |
| - name: Install wasm-opt | |
| run: npm i wasm-opt -g | |
| - uses: jetli/[email protected] | |
| with: | |
| # Optional version of wasm-pack to install(eg. 'v0.9.1', 'latest') | |
| version: "latest" | |
| - name: Install nextest | |
| uses: taiki-e/install-action@v1 | |
| with: | |
| tool: nextest | |
| - run: rustup toolchain install 1.83.0 --profile minimal | |
| - run: rustup target add wasm32-unknown-unknown | |
| - uses: jetli/[email protected] | |
| with: | |
| version: "0.2.100" | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Build WASM release-build | |
| run: pnpm release-wasm | |
| - name: Create Release Pull Request or Publish to npm | |
| id: changesets | |
| uses: changesets/action@v1 | |
| with: | |
| title: "chore: version packages" | |
| commit: "chore: version packages" | |
| version: pnpm run ci-release-wasm-version | |
| publish: pnpm run ci-release-wasm-publish | |
| env: | |
| GITHUB_TOKEN: ${{ github.token }} |