Skip to content

feat: add styleOptions.stylesRoot prop #54

feat: add styleOptions.stylesRoot prop

feat: add styleOptions.stylesRoot prop #54

Workflow file for this run

# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Continuous integration and deployment
on:
push:
branches:
- main
tags:
- '*'
pull_request:
branches:
- main
jobs:
# "build" job will build artifacts for production.
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
steps:
- name: Checking out for ${{ github.ref }}
uses: actions/checkout@v2
- name: Using Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Running npx version-from-git --no-git-tag-version
if: ${{ startsWith(github.ref, 'refs/heads/') }}
run: npx version-from-git --no-git-tag-version
- name: Installing dependencies
run: npm ci
- name: Bootstrapping packages
run: npm run bootstrap
- name: Propagating versions
run: |
node_modules/.bin/lerna version --force-publish --no-git-tag-version --no-push --yes `cat package.json | jq -r .version`
- name: Building for production
env:
NODE_ENV: production
SKIP_PREFLIGHT_CHECK: 'true'
run: npm run build --if-present
- name: Copying documents
run: |
cp CHANGELOG.md packages/component
cp LICENSE packages/component
cp README.md packages/component
- name: Running npm pack
run: |
cd packages/component
npm pack
- name: Uploading npm-tarball
uses: actions/upload-artifact@v2
with:
name: npm-tarball
path: 'packages/component/*.tgz'
- name: Uploading gh-pages
uses: actions/upload-artifact@v2
with:
name: gh-pages
path: 'packages/playground/build/**/*'
# "test" job will only run when not deploying, will build for instrumentation.
test:
if: ${{ !startsWith(github.ref, 'refs/heads/') && !startsWith(github.ref, 'refs/tags/') }}
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x, 16.x]
steps:
- name: Checking out for ${{ github.ref }}
uses: actions/checkout@v2
- name: Using Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Running npx version-from-git --no-git-tag-version
if: ${{ startsWith(github.ref, 'refs/heads/') }}
run: npx version-from-git --no-git-tag-version
- name: Installing dependencies
run: npm ci
- name: Bootstrapping packages
run: npm run bootstrap
- name: Propagating versions
run: node_modules/.bin/lerna version --force-publish --no-git-tag-version --no-push --yes `cat package.json | jq -r .version`
- name: Running static code analysis
run: |
cd packages/component
npm run precommit src/
- name: Building for instrumentation
env:
NODE_ENV: test
SKIP_PREFLIGHT_CHECK: 'true'
run: npm run build --if-present
- name: Starting Docker Compose
run: npm run docker:up -- --detach
- name: Testing
run: npm test -- --coverage
- if: always()
name: Stopping Docker Compose
run: npm run docker:down
# "public" job will only run when merging a commit or tag.
# It does not depends on "test" because we assume it already passed pull request status checks and "test" can be unreliable at times.
publish:
needs:
- build
runs-on: ubuntu-latest
if: ${{ startsWith(github.ref, 'refs/heads/') || startsWith(github.ref, 'refs/tags/') }}
steps:
- name: Downloading npm-tarball
uses: actions/download-artifact@v2
with:
name: npm-tarball
- name: Downloading gh-pages
uses: actions/download-artifact@v2
with:
name: gh-pages
path: gh-pages/
- name: Reading package.json
id: read-package-json
run: |
echo "::set-output name=name::$(tar xOf *.tgz package/package.json | jq -r '.name')"
echo "::set-output name=version::$(tar xOf *.tgz package/package.json | jq -r '.version')"
echo "::set-output name=tarball::$(ls *.tgz)"
echo "::set-output name=date::$(date +%Y-%m-%d)"
- name: Publishing ${{ steps.read-package-json.outputs.name }}@${{ steps.read-package-json.outputs.version }}
run: |
npm config set //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}
npm publish *.tgz --tag main
- name: Tagging dist-tag ${{ steps.read-package-json.outputs.name }}@${{ steps.read-package-json.outputs.version }} latest
if: ${{ startsWith(github.ref, 'refs/tags/') }}
run: |
npm dist-tag add ${{ steps.read-package-json.outputs.name }}@${{ steps.read-package-json.outputs.version }} latest
- name: Drafting a new release
uses: actions/create-release@v1
id: create-release
if: ${{ startsWith(github.ref, 'refs/tags/') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: '[${{ steps.read-package-json.outputs.version }}] - ${{ steps.read-package-json.outputs.date }}'
draft: true
- name: Uploading tarball to release
uses: actions/upload-release-asset@v1
if: ${{ startsWith(github.ref, 'refs/tags/') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-release.outputs.upload_url }}
asset_path: ./${{ steps.read-package-json.outputs.tarball }}
asset_name: ${{ steps.read-package-json.outputs.tarball }}
asset_content_type: application/octet-stream
- name: Deploying to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./gh-pages/