Skip to content

Commit

Permalink
chore: add ci workflows (#1)
Browse files Browse the repository at this point in the history
* chore: add ci workflows

* chore: add test script
  • Loading branch information
marvinhagemeister authored Sep 20, 2024
1 parent db6877c commit 5508235
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 1 deletion.
35 changes: 35 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Node.js CI

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
lint-and-format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: denoland/setup-deno@v1
- run: deno fmt --check
- run: deno lint

test:
strategy:
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
node-version: ["20.x"]

runs-on: ${{ matrix.platform }}

steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- run: npm i
- run: npm run build --if-present
- run: npm test
18 changes: 18 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Publish Package to npmjs
on:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v4
with:
node-version: "20.x"
registry-url: "https://registry.npmjs.org"
- run: npm ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
"dist/"
],
"scripts": {
"build": "rimraf dist/ && tsc"
"test": "echo 'test'",
"build": "rimraf dist/ && tsc",
"prepublishOnly": "npm run build"
},
"peerDependencies": {
"vite": "^5.4.6"
Expand Down

0 comments on commit 5508235

Please sign in to comment.