build(deps-dev): update commitlint monorepo to v19 (major) #476
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
# GitHub Actions References: | |
# https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-output-parameter | |
name: βπ | |
on: | |
push: | |
branches: [main, next, beta, alpha] | |
pull_request: | |
types: [opened, synchronize] | |
jobs: | |
test_build: | |
name: β Test and Build β | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
node: [17.x, "lts/*"] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: π Cancel Previous Running Workflows | |
uses: styfle/cancel-workflow-action@0.9.1 | |
- name: ποΈ Checkout | |
uses: actions/checkout@v2.4.0 | |
- name: π¦ Use NodeJS ${{ matrix.node }} | |
uses: actions/setup-node@v2.5.1 | |
with: | |
node-version: ${{ matrix.node }} | |
cache: yarn | |
cache-dependency-path: "**/yarn.lock" | |
- name: β¨ Install Dependencies | |
run: yarn --immutable --check-cache | |
- name: π Run Build | |
run: yarn build | |
- name: π Run Linter | |
run: yarn lint | |
- name: π Run Formatter | |
run: yarn format | |
- name: π§ͺ Run Tests | |
run: yarn test | |
- name: β» Cache dist Directory for Publish | |
uses: actions/cache@v2.1.7 | |
with: | |
path: | | |
**/dist/**/* | |
key: ${{ github.sha }}-${{ runner.os }}-${{ matrix.node }} | |
release: | |
name: π Release β¨ | |
needs: test_build | |
if: github.event_name == 'push' | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
node: ["lts/*"] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: π Cancel Previous Running Workflows | |
uses: styfle/cancel-workflow-action@0.9.1 | |
- name: ποΈ Checkout | |
uses: actions/checkout@v2.4.0 | |
with: | |
fetch-depth: 0 | |
- name: π¦ Use NodeJS LTS | |
uses: actions/setup-node@v2.5.1 | |
with: | |
node-version: ${{ matrix.node }} | |
cache: yarn | |
cache-dependency-path: "**/yarn.lock" | |
- name: β» Restore dist Directory for Publish | |
id: restore-dist | |
uses: actions/cache@v2.1.7 | |
with: | |
path: | | |
**/dist/**/* | |
key: ${{ github.sha }}-${{ runner.os }}-${{ matrix.node }} | |
- name: β¨ Install Dependencies | |
run: yarn --immutable --check-cache | |
- name: π Release | |
env: | |
GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
GIT_AUTHOR_NAME: latipun7 | |
GIT_AUTHOR_EMAIL: latifsulistyo.me@gmail.com | |
GIT_COMMITTER_NAME: latipun7 | |
GIT_COMMITTER_EMAIL: latifsulistyo.me@gmail.com | |
run: yarn release |