test: fix glyph id #36
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: CI/CD | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| env: | |
| EXPIRY_DAYS: 1 | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' && !contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, 'docs:') | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Rust toolchain | |
| uses: actions-rs/toolchain@v1 | |
| with: | |
| toolchain: stable | |
| - name: Cache wasm-pack | |
| id: cache-wasm-pack | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cargo/bin/wasm-pack | |
| key: wasm-pack-${{ runner.os }} | |
| - name: Install wasm-pack | |
| if: steps.cache-wasm-pack.outputs.cache-hit != 'true' | |
| run: cargo install wasm-pack | |
| - name: Set up Bun.js | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: Build Rust project | |
| run: cd markdown-renderer && wasm-pack build --target web --release | |
| - name: Post-process wasm package | |
| run: bun process_wasm_pkg.js | |
| - name: Install dependencies (workspace) | |
| run: bun install | |
| - name: Build library | |
| run: bun run build | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: release-artifact | |
| path: | | |
| dist | |
| package.json | |
| README.md | |
| LICENSE.md | |
| prepare_package.cjs | |
| - name: Publish Library to NPM (dry run) # Keeping the name for context, but it's now Bun | |
| continue-on-error: true | |
| # Only run if the commit is tagged with v<version> | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} # Bun can also use NPM tokens | |
| run: bun publish --dry-run | |
| # job depends on the build job | |
| release: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| # make sure it only run on main and ensure that it does not contain [skip ci] in the commit message | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' && !contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, 'docs:') | |
| permissions: | |
| contents: write | |
| issues: write | |
| pull-requests: write | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Download artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: release-artifact | |
| path: release-package | |
| - name: Set up Bun.js | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: Install semantic-release and plugins | |
| run: bun install -g semantic-release@24.2.9 @semantic-release/git@10.0.1 @semantic-release/changelog@6.0.3 @semantic-release/npm@13.0.0 @semantic-release/github@11.0.6 @semantic-release/commit-analyzer@13.0.1 @semantic-release/release-notes-generator@14.1.0 | |
| - name: Release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| run: cd release-package && bun prepare_package.cjs && bunx semantic-release |