catch datastream init errors #211
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] | |
| jobs: | |
| compile: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v6 | |
| - name: Set up node | |
| uses: actions/setup-node@v6 | |
| - name: Install dependencies | |
| run: yarn install --frozen-lockfile | |
| - name: Compile | |
| run: yarn build | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v6 | |
| - name: Set up node | |
| uses: actions/setup-node@v6 | |
| - name: Install dependencies | |
| run: yarn install --frozen-lockfile | |
| - name: Test | |
| run: yarn test | |
| publish: | |
| needs: [ compile, test ] | |
| if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v6 | |
| - name: Set up node | |
| uses: actions/setup-node@v6 | |
| - name: Install dependencies | |
| run: yarn install --frozen-lockfile | |
| - name: Build | |
| run: yarn build | |
| - name: Publish to npm | |
| run: | | |
| npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN} | |
| publish() { # use latest npm to ensure OIDC support | |
| npx -y npm@latest publish "$@" | |
| } | |
| if [[ ${GITHUB_REF} == *alpha* ]]; then | |
| publish --access public --tag alpha | |
| elif [[ ${GITHUB_REF} == *beta* ]]; then | |
| publish --access public --tag beta | |
| else | |
| publish --access public | |
| fi | |
| env: | |
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |