Merge pull request #1080 from JonnyAdaptableTools/patch-1 #1
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: npm-build | |
# Only trigger on: | |
# - master branch | |
# - PR or Pull Request event types | |
# - Exclide Docusaurus files: this file, docs/** and website/** | |
on: | |
push: | |
branches: | |
- master | |
- release/** | |
paths-ignore: | |
- '.github/workflows/docusaurus.yml' | |
- 'docs/**' | |
- 'website/**' | |
pull_request: | |
branches: | |
- master | |
- release/* | |
paths-ignore: | |
- '.github/workflows/docusaurus.yml' | |
- 'docs/**' | |
- 'website/**' | |
jobs: | |
package-build: | |
name: Build on Node ${{ matrix.node }} and ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
node: [18.16.x] | |
os: [ubuntu-latest, windows-latest] | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v2 | |
- name: Use Node ${{ matrix.node }} | |
uses: actions/setup-node@v1 | |
with: | |
node-version: ${{ matrix.node }} | |
- name: Install dependencies | |
uses: bahmutov/npm-install@c5482d70ec8706408996e31ac94075030694993f #v1.8.32 | |
- name: Lint | |
run: yarn lint | |
- name: Test | |
run: yarn test --ci --coverage --maxWorkers=2 | |
- name: Build | |
run: yarn build | |
pacakge-publish: | |
if: ${{ github.event_name == 'push' }} | |
needs: package-build | |
name: Publish package to ${{ matrix.name }} | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
include: | |
- name: NPM | |
registry: https://registry.npmjs.org | |
token-name: NPM_TOKEN | |
- name: GitHub | |
registry: https://npm.pkg.github.com | |
token-name: GITHUB_TOKEN | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v2 | |
- name: Configure Node | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 18.16.x | |
registry-url: ${{ matrix.registry }} | |
- name: Check package version | |
id: check-version | |
uses: PostHog/check-package-version@adccce0ed9759513476413668bd2a5c995450bde #v2.0.0 | |
- name: Package version info | |
run: | | |
echo "Committed version: ${{ steps.check-version.outputs.committed-version }}" | |
echo "Published version: ${{ steps.check-version.published-version }}" | |
echo "Is version new: ${{ steps.check-version.outputs.is-new-version }}" | |
- name: Install dependencies | |
if: steps.check-version.outputs.is-new-version == 'true' | |
uses: bahmutov/npm-install@c5482d70ec8706408996e31ac94075030694993f #v1.8.32 | |
- name: Publish | |
if: steps.check-version.outputs.is-new-version == 'true' | |
run: yarn publish --access public | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets[matrix.token-name] }} |