fix: npm OIDC #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 | |
| on: | |
| push: | |
| branches: [main] | |
| tags: | |
| - "v*" | |
| env: | |
| CARGO_TERM_COLOR: always | |
| permissions: | |
| id-token: write | |
| contents: read | |
| jobs: | |
| check: | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: wasm32-unknown-unknown | |
| - name: Cargo check | |
| run: cargo check --all-features --verbose --manifest-path js/wasm/Cargo.toml | |
| clippy: | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: wasm32-unknown-unknown | |
| components: clippy | |
| - name: Cargo clippy | |
| run: cargo clippy --all-features --verbose --manifest-path js/wasm/Cargo.toml | |
| test_oca-js_wasm: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: wasm32-unknown-unknown | |
| - name: Install wasm-bindgen-cli | |
| run: cargo install -f wasm-bindgen-cli --version 0.2.110 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20.x" | |
| - name: Setup yarn | |
| run: npm install -g yarn | |
| - name: Build wasm | |
| working-directory: js/wasm | |
| run: bash build-pkg.sh | |
| - name: Install dependencies | |
| working-directory: js/example | |
| run: yarn install --network-concurrency 1 | |
| - name: Run tests | |
| working-directory: js/example | |
| run: yarn test | |
| publish_oca-js_wasm: | |
| runs-on: ubuntu-latest | |
| if: github.ref_type == 'tag' | |
| needs: | |
| - test_oca-js_wasm | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: wasm32-unknown-unknown | |
| - name: Install wasm-bindgen-cli | |
| run: cargo install wasm-bindgen-cli --version 0.2.92 | |
| - name: Build wasm | |
| working-directory: js/wasm | |
| run: bash build-pkg.sh | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20.x" | |
| registry-url: "https://registry.npmjs.org" | |
| - name: Install yarn | |
| run: npm install -g yarn | |
| - name: Install package dependencies | |
| working-directory: js/wasm/pkg | |
| run: yarn install | |
| - name: Publish to npm | |
| working-directory: js/wasm/pkg | |
| run: yarn publish |