Skip to content

Commit

Permalink
Added CI pipeline to the project (#3)
Browse files Browse the repository at this point in the history
* CI pipeline added

* Change on package.json scripts to test the project

* Metadata changes for the repository

* fix on the pipeline so the publish step is triggered as is intended
  • Loading branch information
ctw-joao-luis authored Oct 10, 2024
1 parent 6aea6ba commit 0221b50
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 5 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: CI

on:
push:
branches: main
tags: "v*"
pull_request:
branches: "*"

jobs:
push:
name: push
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18.x
registry-url: https://registry.npmjs.org
cache: yarn

- run: yarn install --frozen-lockfile
- run: yarn run build
- run: yarn run test

- name: Publish to NPM
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
run: yarn publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
{
"name": "comlink",
"version": "4.4.2",
"version": "1.0.0",
"description": "Comlink makes WebWorkers enjoyable",
"main": "dist/umd/comlink.js",
"module": "dist/esm/comlink.mjs",
"types": "dist/umd/comlink.d.ts",
"sideEffects": false,
"scripts": {
"prepack": "npm run build",
"build": "rollup -c",
"build": "rollup -c && npm run fmt",
"test:unit": "karma start",
"test:node": "mocha ./tests/node/main.mjs",
"test:types": "tsc -p ./tests/tsconfig.json",
"test:types:watch": "npm run test:types -- --watch",
"test": "npm run fmt_test && npm run build && npm run test:types && npm run test:unit && npm run test:node",
"test": "npm run fmt_test && npm run test:types && npm run test:unit && npm run test:node",
"fmt": "prettier --write './*.{mjs,js,ts,md,json,html}' './{src,docs,tests}/{,**/}*.{mjs,js,ts,md,json,html}'",
"fmt_test": "test $(prettier -l './*.{mjs,js,ts,md,json,html}' './{src,docs,tests}/{**/,}*.{mjs,js,ts,md,json,html}' | wc -l) -eq 0",
"watchtest": "CHROME_ONLY=1 karma start --no-single-run"
},
"author": {
"name": "Surma",
"email": "surma@google.com"
"name": "Lichtblick",
"email": "lichtblick@bmwgroup.com"
},
"files": [
"dist"
Expand Down

0 comments on commit 0221b50

Please sign in to comment.