diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3a4f76f0..8e9f48a4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -53,6 +53,7 @@ jobs: - uses: ipfs/aegir/actions/cache-node-modules@master - run: npm run test:node -- --cov --bail - uses: codecov/codecov-action@v1 + test-chrome: needs: check runs-on: ubuntu-latest @@ -63,6 +64,7 @@ jobs: node-version: lts/* - uses: ipfs/aegir/actions/cache-node-modules@master - run: npm run test:browser -- -t browser -t webworker --bail + test-firefox: needs: check runs-on: ubuntu-latest @@ -73,6 +75,7 @@ jobs: node-version: lts/* - uses: ipfs/aegir/actions/cache-node-modules@master - run: npm run test:browser -- -t browser -t webworker --bail -- --browser firefox + test-ts: needs: check runs-on: ubuntu-latest @@ -83,6 +86,7 @@ jobs: node-version: lts/* - uses: ipfs/aegir/actions/cache-node-modules@master - run: npm run test:ts + test-interop: needs: check runs-on: ubuntu-latest @@ -93,3 +97,28 @@ jobs: node-version: lts/* - uses: ipfs/aegir/actions/cache-node-modules@master - run: npm run test:interop -- --bail -- --exit + + release: + runs-on: ubuntu-latest + needs: [test-node, test-chrome, test-firefox, test-ts, test-interop] + if: github.event_name == 'push' && github.ref == 'refs/heads/master' + steps: + - uses: GoogleCloudPlatform/release-please-action@v2 + id: release + with: + token: ${{ secrets.GITHUB_TOKEN }} + release-type: node + bump-minor-pre-major: true + - uses: actions/checkout@v2 + if: ${{ steps.release.outputs.release_created }} + - uses: actions/setup-node@v2 + with: + node-version: lts/* + registry-url: 'https://registry.npmjs.org' + if: ${{ steps.release.outputs.release_created }} + - uses: bahmutov/npm-install@v1 + if: ${{ steps.release.outputs.release_created }} + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} + if: ${{ steps.release.outputs.release_created }}