@foxglove/ws-protocol: Update to spec changes #1514
Workflow file for this run
This file contains 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: ["releases/**"] | |
pull_request: | |
branches: ["*"] | |
jobs: | |
typescript: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
package: [ws-protocol, ws-protocol-examples, test-client-web-app] | |
node-version: [16.x, 18.x] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
registry-url: https://registry.npmjs.org | |
cache: yarn | |
- name: Ensure examples use current version of ws-protocol package | |
run: "! grep '@foxglove/ws-protocol' yarn.lock" | |
- run: yarn install --frozen-lockfile | |
- run: yarn workspace @foxglove/${{ matrix.package }} lint:ci | |
- run: yarn workspace @foxglove/${{ matrix.package }} test | |
- name: Publish to NPM | |
if: ${{ startsWith(github.ref, format('refs/tags/releases/typescript/{0}/v', matrix.package)) }} | |
run: yarn workspace @foxglove/${{ matrix.package }} publish --access public | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} | |
python: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: python | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: 3.8 | |
cache: pipenv | |
- run: pip install pipenv>=2022.1.8 | |
- run: pipenv install --dev --deploy | |
- run: pipenv run black --check . | |
- run: pipenv run pyright src tests | |
- run: pipenv run pytest | |
- run: pipenv run python -m build | |
- name: Publish to TestPyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
if: ${{ !github.event.pull_request.head.repo.fork && github.actor != 'dependabot[bot]' }} | |
with: | |
user: __token__ | |
password: ${{ secrets.TESTPYPI_API_TOKEN }} | |
packages_dir: python/dist | |
repository_url: https://test.pypi.org/legacy/ | |
skip_existing: true | |
- name: Publish to PyPI | |
if: ${{ startsWith(github.ref, 'refs/tags/releases/python/v') }} | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_API_TOKEN }} | |
packages_dir: python/dist | |
cpp: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
make_cmd: [format-check, build, build-cpp20, build-boost-asio] | |
defaults: | |
run: | |
working-directory: cpp | |
name: cpp (${{ matrix.make_cmd }}) | |
steps: | |
- uses: actions/checkout@v4 | |
- run: make ${{ matrix.make_cmd }} |