Skip to content

Commit e583eb5

Browse files
kosztiwendigo
authored andcommitted
Add github workflows
1 parent 1299a0e commit e583eb5

File tree

4 files changed

+92
-0
lines changed

4 files changed

+92
-0
lines changed

.github/workflows/ci.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
defaults:
13+
run:
14+
working-directory: precise
15+
16+
steps:
17+
- name: Checkout repo
18+
uses: actions/checkout@v4
19+
20+
- name: Setup node
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: '22'
24+
25+
# Temporarily disabling this step due to formatting issues.
26+
# Linter and prettier) currently throws numerous warnings.
27+
# Code style checks will be re-enabled in a future PR that includes a codebase reformat.
28+
# - name: Check code style
29+
# run: npm run check:clean
30+
31+
- name: Build package
32+
run: npm run package:clean

.github/workflows/release.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Publish Package to npmjs
2+
3+
on:
4+
release:
5+
types: [created]
6+
pull_request:
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
defaults:
12+
run:
13+
working-directory: precise
14+
15+
steps:
16+
- name: Checkout repo
17+
uses: actions/checkout@v4
18+
19+
- name: Setup node
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: '22'
23+
24+
- name: Install dependencies
25+
run: npm ci
26+
27+
- name: Build package
28+
run: npm run build
29+
30+
# This step is a placeholder for publishing to npm.
31+
# The project structure and Node configuration will need to be adjusted
32+
# before this can be enabled and work as intended.
33+
- name: Publish to npm
34+
if: github.event_name == 'release'
35+
run: npm publish
36+
env:
37+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

precise/package-lock.json

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

precise/package.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@
88
"dev": "vite",
99
"build": "tsc && vite build",
1010
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
11+
"package": "npm install && npm run build",
12+
"package:clean": "npm clean-install && npm run build",
13+
"prettier:format": "prettier --write \"./src/**/*.{ts,tsx}\"",
14+
"prettier:check": "prettier --check \"./src/**/*.{ts,tsx}\"",
15+
"check": "npm install && npm run lint && npm run prettier:check",
16+
"check:clean": "npm clean-install && npm run lint && npm run prettier:check",
1117
"preview": "vite preview",
1218
"antlr4ng": "antlr4ng -visitor -listener -Dlanguage=TypeScript -o src/generated/lexer/SqlBase.g4 trino/SqlBase.g4"
1319
},
@@ -17,6 +23,7 @@
1723
"antlr4ng": "^3.0.4",
1824
"lucide-react": "^0.460.0",
1925
"precise": "file:",
26+
"prettier": "^3.5.3",
2027
"react": "^18.2.0",
2128
"react-dnd": "^16.0.1",
2229
"react-dnd-html5-backend": "^16.0.1",

0 commit comments

Comments
 (0)