Add readme to streamql and publish #48
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 | |
| on: | |
| push: | |
| branches: | |
| - 'main' | |
| permissions: | |
| id-token: write # Required for OIDC | |
| contents: read | |
| packages: write | |
| jobs: | |
| publish-rust: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| strategy: | |
| max-parallel: 1 | |
| matrix: | |
| crate: | |
| - httpql | |
| - streamql | |
| steps: | |
| - name: Checkout project | |
| uses: actions/checkout@v3 | |
| - name: Install Mise | |
| uses: caido/action-mise-action@v3.2.0 | |
| with: | |
| working_directory: . | |
| version: ${{ vars.CI__MISE_VERSION }} | |
| - name: Get version | |
| id: meta | |
| working-directory: ./rust/${{ matrix.crate }} | |
| run: | | |
| CRATE_VERSION=$(sed -nE 's/^\s*version = "(.*?)"/\1/p' Cargo.toml) | |
| PUBLISHED_VERSION=$(cargo search ${{ matrix.crate }} --limit 1 | sed -nE 's/^[^"]*"//; s/".*//1p' -) | |
| if [ "$CRATE_VERSION" != "$PUBLISHED_VERSION" ]; then | |
| echo "release=true" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Authenticate with crates.io | |
| id: auth | |
| if: steps.meta.outputs.release == 'true' | |
| uses: rust-lang/crates-io-auth-action@b7e9a28eded4986ec6b1fa40eeee8f8f165559ec # v1.0.3 | |
| - name: Publish ${{ matrix.crate }} | |
| if: steps.meta.outputs.release == 'true' | |
| working-directory: ./rust/${{ matrix.crate }} | |
| run: | | |
| cargo login ${{ steps.auth.outputs.token }} | |
| cargo publish --no-verify | |
| publish-js: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| strategy: | |
| max-parallel: 1 | |
| matrix: | |
| package: | |
| - httpql | |
| - streamql | |
| steps: | |
| - name: Checkout project | |
| uses: actions/checkout@v3 | |
| - name: Install Mise | |
| uses: caido/action-mise-action@v3.2.0 | |
| with: | |
| working_directory: . | |
| version: ${{ vars.CI__MISE_VERSION }} | |
| - name: Install dependencies | |
| working-directory: ./js | |
| run: pnpm install | |
| - name: Build | |
| working-directory: ./js | |
| run: pnpm run build | |
| - name: Publish | |
| working-directory: ./js | |
| run: pnpm --filter ${{ matrix.package }} -r publish --access public | |
| - name: Publish internal | |
| working-directory: ./js | |
| env: | |
| NPM_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| mv .npmrc.github .npmrc | |
| pnpm --filter ${{ matrix.package }} -r publish --no-git-checks |