This repository has been archived by the owner on Oct 10, 2024. It is now read-only.
Build and Publish #6
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: Build and Publish | |
on: | |
push: | |
branches: ["main"] | |
# We only deploy on tags and main branch | |
tags: | |
# Only run on tags that match the following regex | |
# This will match tags like 1.0.0, 1.0.1, etc. | |
- "[0-9]+.[0-9]+.[0-9]+" | |
# Build on pull requests | |
pull_request: | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
# Checkout the repository | |
- name: Checkout | |
uses: actions/checkout@v4 | |
# Set node version | |
- name: set node version | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
# Install Build stuff | |
- name: Install Dependencies | |
run: | | |
npm install | |
# Ruff | |
- name: ESlint check | |
run: | | |
./node_modules/.bin/eslint . | |
publish: | |
needs: lint | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags') | |
steps: | |
# Checkout the repository | |
- name: Checkout | |
uses: actions/checkout@v4 | |
# Set node version | |
- name: set node version | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
# Install Build stuff | |
- name: Install Dependencies | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
run: | | |
npm version ${{ github.ref_name }} | |
npm install | |
npm publish | |