Skip to content

Workspace Fork

Workspace Fork #305

Workflow file for this run

name: CI
on:
pull_request:
push:
# Run CI on all branch pushes. Must use this syntax,
# as we also need to run CI on tag pushes.
branches:
- "**"
tags:
- v[0-9]+.[0-9]+.[0-9]+*
jobs:
build:
name: Build, lint, and publish
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Node environment
uses: actions/setup-node@v3
with:
node-version: lts/*
cache: 'yarn'
- name: Install yarn packages
run: yarn install --immutable
- name: Run linting test
run: yarn lint
# TODO: Fix
# - name: Run unit tests
# run: yarn test
- name: Create a production build
run: yarn build
- name: Get the publishing version number
id: version-number
run: echo "::set-output name=version::$(git describe --tags | tail -c +2)"
if: startsWith(github.ref, 'refs/tags/')
- name: Publish the package
run: yarn publish --new-version ${{ steps.version-number.outputs.version }} --non-interactive --no-git-tag-version
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
if: startsWith(github.ref, 'refs/tags/')