oceanprotocol/ocean.js

View on GitHub
.github/workflows/publish.yml

Summary

Maintainability
Test Coverage
name: 'Publish'

on:
  push:
    tags:
      - '**'

jobs:
  npm:
    runs-on: ubuntu-latest
    env:
      NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-node@v4
        with:
          node-version: '20'
          registry-url: https://registry.npmjs.org/
      - run: npm ci

      # pre-releases, triggered by `next` as part of git tag
      - run: npm publish --tag next
        if: ${{ contains(github.ref, 'next') }}

      # production releases
      - run: npm publish
        if: ${{ !contains(github.ref, 'next') }}