Skip to content

feat: allow raw queries for where filter #241

feat: allow raw queries for where filter

feat: allow raw queries for where filter #241

Workflow file for this run

name: Main
on: push
permissions:
id-token: write # Required for OIDC
contents: read
jobs:
build:
name: Build CLI
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22.14.0
- name: Install dependencies
run: npm ci
- name: Build CLI
run: |
npm run prettier
npm run lint
npm run build
- name: Upload dist files
uses: actions/upload-artifact@v4
with:
name: build
path: dist
generate:
name: Generate SDK
runs-on: ubuntu-latest
needs: build
strategy:
matrix:
target: [node, node.rx, browser, browser.rx]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22.14.0
- name: Install dependencies
run: npm ci
- name: Download dist files
uses: actions/download-artifact@v4
with:
name: build
path: dist
- name: Generate SDK
run: |
chmod +x ./bin/cli.js
./bin/cli.js test/openapi.json --target ${{ matrix.target }}
./bin/cli.js test/openapi_v2.json --target ${{ matrix.target }}
./bin/cli.js test/openapi_v3.json --target ${{ matrix.target }}
test:
name: Test
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22.14.0
- name: Install dependencies
run: npm ci
- name: Download dist files
uses: actions/download-artifact@v4
with:
name: build
path: dist
- name: Generate SDK for tests
run: |
chmod +x ./bin/cli.js
./bin/cli.js test/openapi_v3.json --target browser --use-query-language
- name: Run type-check
run: npm run type-check
- name: Run tests
run: npm run test
publish:
name: Publish release version
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
needs: build
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22.14.0
- name: Download dist files
uses: actions/download-artifact@v4
with:
name: build
path: dist
- name: Publish release
run: |
npm install -g npm@latest
npm publish --access public --tag latest
publish_snapshot:
name: Publish snapshot version
runs-on: ubuntu-latest
if: |
github.ref_name == 'master' &&
!startsWith(github.ref, 'refs/tags/v')
needs: build
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22.14.0
- name: Download dist files
uses: actions/download-artifact@v4
with:
name: build
path: dist
- name: Publish snapshot
run: |
npm install -g npm@latest
LATEST_TAG=$(git describe --tags --abbrev=0)
LATEST_TAG_RAW=$(echo "$LATEST_TAG" | sed 's/v//')
COMMITS_SINCE_LAST_TAG=$(git rev-list "$LATEST_TAG"..HEAD --count)
VERSION="$LATEST_TAG_RAW-dev.$COMMITS_SINCE_LAST_TAG"
npm version "$VERSION" --git-tag-version=false
npm publish --access public --tag snapshot