Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: build in CI and publish on source #96

Merged
merged 5 commits into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Build

on:
pull_request:
types: [opened, edited, reopened, synchronize]
paths:
- src/**
- package.json
- vite.config.js

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'

- name: Install Dependencies
run: npm i

- name: Build
run: npm run build
26 changes: 26 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Lint

on:
pull_request:
types: [opened, edited, reopened, synchronize]

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'

- name: Install Dependencies
run: npm i

- name: Lint
run: npm run lint
5 changes: 4 additions & 1 deletion .github/workflows/publish-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ on:
push:
branches:
- main
paths:
- src/**

jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -19,4 +22,4 @@ jobs:
- run: npm run build
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@
"scripts": {
"prepare": "node -e \"try { require('husky').install() } catch (e) {if (e.code !== 'MODULE_NOT_FOUND') throw e}\"",
"start": "vite",
"build": "npm run lint:scripts && npm run lint:styles && vite build",
"build": "vite build",
"lint:scripts": "eslint --fix --ext .jsx,js --ignore-path .gitignore .",
"lint:styles": "stylelint src/**/*.{css,scss}"
"lint:styles": "stylelint src/**/*.{css,scss}",
"lint": "npm run lint:scripts && npm run lint:styles"
},
"publishConfig": {
"access": "public"
Expand Down
Loading