Main #200
Workflow file for this run
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: Main | |
on: | |
push: | |
tags: | |
- v* | |
pull_request: | |
branches: [master] | |
jobs: | |
testAndBuild: | |
name: 'Test and build' | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [18.x, 20.x] | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v2 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v1 | |
with: | |
node-version: ${{ matrix.node-version }} | |
registry-url: https://npm.pkg.github.com | |
always-auth: true | |
- name: Install dependencies | |
run: yarn | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.GH_PACKAGES_TOKEN }} | |
- name: Install dependencies | |
run: yarn | |
- name: Lint | |
run: yarn lint | |
# temporarily disabled test to test integration, it is working locally but not on the ci | |
# - name: Test | |
# run: yarn test | |
# env: | |
# CI: 'true' | |
- name: Build | |
run: yarn build | |
- name: Upload artifacts | |
if: contains(github.ref, 'refs/tags/v') && matrix.node-version == '14.x' | |
uses: actions/upload-artifact@v1 | |
with: | |
name: artifacts | |
path: ./dist | |
publishGitHub: | |
name: 'Publish to GitHub Packages' | |
runs-on: ubuntu-latest | |
needs: testAndBuild | |
if: contains(github.ref, 'refs/tags/v') | |
strategy: | |
matrix: | |
node-version: [14.x] | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v2 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v1 | |
with: | |
node-version: ${{ matrix.node-version }} | |
registry-url: https://npm.pkg.github.com | |
always-auth: true | |
- name: Download artifacts | |
uses: actions/download-artifact@v1 | |
with: | |
name: artifacts | |
path: ./dist | |
- name: Publish package | |
run: yarn publish --access public | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.GH_PACKAGES_TOKEN }} | |
publishNpm: | |
name: 'Publish to npm' | |
runs-on: ubuntu-latest | |
needs: testAndBuild | |
if: contains(github.ref, 'refs/tags/v') | |
strategy: | |
matrix: | |
node-version: [14.x] | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v2 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v1 | |
with: | |
always-auth: true | |
node-version: ${{ matrix.node-version }} | |
- name: Download artifacts | |
uses: actions/download-artifact@v1 | |
with: | |
name: artifacts | |
path: ./dist | |
- name: Publish package | |
run: | | |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc | |
yarn publish --access public |