Release 0.61.0 #97
Workflow file for this run
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*' | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| build-and-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: wasm32-unknown-unknown | |
| - name: Cache Rust dependencies | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| cache-dependency-path: ts/package-lock.json | |
| - name: Install npm dependencies | |
| working-directory: ts | |
| run: npm ci | |
| - name: Run pre-commit checks | |
| run: ./.githooks/pre-commit | |
| - name: Install wasm-pack | |
| uses: jetli/wasm-pack-action@v0.4.0 | |
| - name: Build WASM (Node.js and Web) | |
| run: | | |
| wasm-pack build --target nodejs --out-dir ts/wasm | |
| wasm-pack build --target web --out-dir ts/wasm-web | |
| cp ts/wasm-web/sqlparser_rs_wasm.js ts/wasm/sqlparser_rs_wasm_web.js | |
| cp ts/wasm-web/sqlparser_rs_wasm_bg.wasm ts/wasm/sqlparser_rs_wasm_web_bg.wasm | |
| rm -rf ts/wasm-web | |
| - name: Build TypeScript | |
| working-directory: ts | |
| run: npm run build:ts | |
| - name: Run tests | |
| working-directory: ts | |
| run: npm test | |
| - name: Upload build artifacts | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: build-artifacts | |
| path: | | |
| ts/wasm/ | |
| ts/dist/ | |
| ts/package.json | |
| ts/package-lock.json | |
| ts/README.md | |
| retention-days: 1 | |
| publish: | |
| needs: build-and-test | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - name: Download build artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: build-artifacts | |
| path: ts | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '24' | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: Publish to npm | |
| working-directory: ts | |
| run: | | |
| VERSION="${GITHUB_REF#refs/tags/v}" | |
| if [[ "$VERSION" == *"rc"* ]]; then | |
| npm publish --access public --ignore-scripts --tag rc | |
| else | |
| npm publish --access public --ignore-scripts | |
| fi | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| NPM_CONFIG_PROVENANCE: true |