name: CI on: - push - pull_request jobs: test: name: Test on Node.js ${{ matrix.node-version }} runs-on: ubuntu-20.04 strategy: matrix: node-version: [10, 12, 13, 14] steps: - uses: actions/checkout@v2 with: fetch-depth: 0 # fetch all history to make `git describe` work - name: Setup Node.js ${{ matrix.node-version }} uses: actions/setup-node@v2 with: node-version: ${{ matrix.node-version }} - run: yarn install - run: yarn build - run: yarn bundle - run: yarn test - run: yarn lint publish: name: Publish to npmjs and GitHub Releases needs: [test] if: startsWith(github.ref, 'refs/tags/v') runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2 with: fetch-depth: 0 # fetch all history to make `git describe` work - run: sudo apt-get install asciidoctor pandoc - uses: actions/setup-node@v2 with: node-version: 14 registry-url: https://registry.npmjs.org - run: yarn install - name: Generate source tarball run: ./scripts/create-src-tarball dist/ipynb2html-${GITHUB_REF/refs\/tags\//}-src.tar.gz - run: yarn build - run: yarn bundle - name: Publish packages to npmjs run: yarn publish-all --non-interactive env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Upload tarballs to Releases uses: softprops/action-gh-release@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: fail_on_unmatched_files: true files: | dist/*.tar.gz packages/ipynb2html-cli/dist/*.tar.gz packages/ipynb2html-cli/dist/*.zip