loro/.github/workflows/release_wasm.yml

61 lines
1.5 KiB
YAML
Raw Normal View History

2024-04-14 13:55:35 +00:00
name: Release WASM
on:
push:
branches:
- main
jobs:
release:
name: Release
runs-on: macos-14
steps:
- name: Checkout Repo
uses: actions/checkout@v4
2024-04-14 13:55:35 +00:00
2024-07-12 08:15:54 +00:00
- uses: pnpm/action-setup@v4
2024-05-14 03:15:05 +00:00
with:
version: 8
2024-04-14 13:55:35 +00:00
- name: Setup Node.js 20.x
uses: actions/setup-node@v4
2024-04-14 13:55:35 +00:00
with:
node-version: 20.x
cache: pnpm
cache-dependency-path: ./pnpm-lock.yaml
2024-04-14 13:55:35 +00:00
- name: Setup Deno
uses: denoland/setup-deno@v1
with:
deno-version: v2.x
2024-04-14 13:55:35 +00:00
2024-04-14 14:04:59 +00:00
- name: Install wasm-opt
run: npm i wasm-opt -g
2024-04-14 13:55:35 +00:00
- uses: jetli/wasm-pack-action@v0.4.0
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
fix: dead loop when importing updates (#570) Fix the dead loop issue here: https://gist.github.com/sunflowerdeath/c0e2b46b6f5d2e32d368f8e04f730237 # Reason for the Dead Loop in `find_common_ancestor` ### Original Assumptions 1. **Dependency Assumption** If a DagNode is depended upon by other nodes, the direction of this dependency will only point to before the end of the node. This assumption is used in system design. 2. **Node Overlap Assumption** DagNodes do not overlap with each other. When retrieving DagNodes from two different positions: - They are either completely identical - Or they do not overlap at all - If there is overlap, it means they are the same node ### Current Issues 1. **Issues Caused by Lazy Loading** Due to the use of lazy loading, new situations have arisen. Initially: - A certain DagNode is not depended upon by other DagNodes - Therefore, the initially retrieved form is complete 2. **Impact of Subsequent Loading** After loading additional DagNodes: - The newly loaded DagNode may depend on the internal position of the previously complete DagNode - This causes the originally complete DagNode to be split into multiple smaller DagNodes 3. **Violation of Original Assumptions** In this case, when retrieving the content of the original DagNode again: - Other DagNode dependencies may appear in the middle - There may be overlaps on the DagNode - This violates the original design assumptions # Fix Approach Remove the assumption in the original implementation that "overlapping DagNodes will not occur." When overlapping DagNodes are found, retain the shorter one and remove the longer one.
2024-11-29 05:01:15 +00:00
- run: rustup toolchain install 1.83.0 --profile minimal
2024-04-14 13:55:35 +00:00
- run: rustup target add wasm32-unknown-unknown
- uses: jetli/wasm-bindgen-action@v0.2.0
with:
version: "0.2.92"
2024-04-14 13:55:35 +00:00
- 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:
2024-05-14 03:15:05 +00:00
title: "chore: version packages"
commit: "chore: version packages"
2024-04-14 13:55:35 +00:00
publish: pnpm changeset publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}