Skip to content

release - v1.1.1

release - v1.1.1 #31

Workflow file for this run

name: npm-publish
on:
push:
branches: [ main ]
tags:
- '*'
pull_request:
branches: [ main ]
jobs:
build-and-test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.10.0]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm install && npm run build && npm test
- run: cd example && npm i --legacy-peer-deps && npm run build
deploy-to-github-pages:
runs-on: ubuntu-latest
needs: build-and-test
if: github.event_name == 'push'
steps:
- uses: actions/checkout@v2
- name: build pages
run: |
cd example
npm install --legacy-peer-deps
npm run build
- name: deploy pages
uses: JamesIves/[email protected]
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: example/build
deploy-to-npm:
runs-on: ubuntu-latest
needs: build-and-test
if: startsWith(github.ref, 'refs/tags/')
steps:
- 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://registry.npmjs.org/'
- run: npm ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
deploy-to-npm-next:
runs-on: ubuntu-latest
needs: build-and-test
if: github.event_name == 'push'
steps:
- uses: actions/checkout@v2
- name: Check if version is a beta
id: check_version
run: |
VERSION=$(node -p "require('./package.json').version")
if [[ $VERSION == *"-beta"* ]]; then
echo "Version is a beta: $VERSION"
echo "::set-output name=is_beta::true"
else
echo "Version is not a beta: $VERSION"
echo "::set-output name=is_beta::false"
fi
- name: Use Node.js ${{ matrix.node-version }}
if: steps.check_version.outputs.is_beta == 'true'
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://registry.npmjs.org/'
- run: npm ci
- if: steps.check_version.outputs.is_beta == 'true'
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}