Merge pull request #467 from dev-five-git/fix-color-typing #1119
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: Publish Package to npm | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| permissions: write-all | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: false | |
| jobs: | |
| benchmark: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| - name: Cargo tarpaulin and fmt | |
| run: | | |
| cargo install cargo-tarpaulin | |
| rustup component add rustfmt clippy | |
| - uses: pnpm/action-setup@v4 | |
| name: Install pnpm | |
| with: | |
| run_install: false | |
| - uses: jetli/wasm-pack-action@v0.4.0 | |
| with: | |
| version: 'latest' | |
| - name: Install Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| registry-url: "https://registry.npmjs.org" | |
| node-version: 22 | |
| cache: 'pnpm' | |
| - run: pnpm i | |
| - run: pnpm build | |
| - name: Benchmark | |
| run: pnpm benchmark | |
| publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| - name: Cargo tarpaulin and fmt | |
| run: | | |
| cargo install cargo-tarpaulin | |
| rustup component add rustfmt clippy | |
| - uses: pnpm/action-setup@v4 | |
| name: Install pnpm | |
| with: | |
| run_install: false | |
| - uses: jetli/wasm-pack-action@v0.4.0 | |
| with: | |
| version: 'latest' | |
| - name: Install Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| registry-url: "https://registry.npmjs.org" | |
| node-version: 22 | |
| cache: 'pnpm' | |
| - run: pnpm i | |
| - run: pnpm build | |
| - run: | | |
| pnpm lint | |
| # rust coverage issue | |
| echo 'max_width = 100000' > .rustfmt.toml | |
| echo 'tab_spaces = 4' >> .rustfmt.toml | |
| echo 'newline_style = "Unix"' >> .rustfmt.toml | |
| echo 'fn_call_width = 100000' >> .rustfmt.toml | |
| echo 'fn_params_layout = "Compressed"' >> .rustfmt.toml | |
| echo 'chain_width = 100000' >> .rustfmt.toml | |
| echo 'merge_derives = true' >> .rustfmt.toml | |
| echo 'use_small_heuristics = "Default"' >> .rustfmt.toml | |
| cargo fmt | |
| rm -rf .rustfmt.toml | |
| - run: pnpm test | |
| - name: Build Landing | |
| run: | | |
| pnpm -F components build-storybook | |
| mv ./packages/components/storybook-static ./apps/landing/public/storybook | |
| pnpm -F landing build | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: ./apps/landing/out | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| - uses: actions/deploy-pages@v4 | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| - name: Upload to codecov.io | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| fail_ci_if_error: true | |
| - name: Create Release Pull Request or Publish to npm | |
| id: changesets | |
| uses: changesets/action@v1 | |
| with: | |
| publish: pnpm changeset publish | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| if: github.ref == 'refs/heads/main' |