Skip to content

Commit c23202e

Browse files
v1rtlclaude
andcommitted
chore: fix CI and add release workflow
- Fix YAML indentation bug in main.yml - Run CI on all pushes/PRs, not just master - Add lint step to CI - Update package.json scripts to use biome and bun test - Add release.yml for npm publishing on git tags Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent d79ead0 commit c23202e

File tree

4 files changed

+44
-39
lines changed

4 files changed

+44
-39
lines changed

.github/workflows/main.yml

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,22 @@
1-
# This is a basic workflow to help you get started with Actions
2-
31
name: CI
42

5-
# Controls when the action will run. Triggers the workflow on push or pull request
6-
# events but only for the master branch
73
on:
84
push:
9-
branches: [master]
105
pull_request:
11-
branches: [master]
126

13-
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
147
jobs:
15-
# This workflow contains a single job called "test"
168
test:
17-
# The type of runner that the job will run on
189
runs-on: ubuntu-latest
19-
20-
# Steps represent a sequence of tasks that will be executed as part of the job
2110
steps:
22-
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
2311
- uses: actions/checkout@v4
2412
- uses: oven-sh/setup-bun@v2
25-
with:
26-
bun-version: latest
13+
with:
14+
bun-version: latest
2715
- run: bun i
16+
- run: bun run lint
2817
- run: bun test --coverage
2918
- name: Coveralls
19+
if: github.ref == 'refs/heads/master'
3020
uses: coverallsapp/github-action@master
3121
with:
3222
github-token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
permissions:
9+
id-token: write
10+
contents: read
11+
12+
jobs:
13+
publish:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- uses: actions/setup-node@v4
19+
with:
20+
node-version: '22'
21+
registry-url: 'https://registry.npmjs.org'
22+
23+
- uses: oven-sh/setup-bun@v2
24+
with:
25+
bun-version: latest
26+
27+
- run: bun i
28+
- run: bun run build
29+
30+
- run: npm publish --provenance --access public
31+
env:
32+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

biome.json

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
{
22
"$schema": "https://biomejs.dev/schemas/1.8.2/schema.json",
33
"files": {
4-
"ignore": [
5-
"node_modules",
6-
"dist",
7-
"coverage",
8-
".pnpm-store"
9-
]
4+
"ignore": ["node_modules", "dist", "coverage", ".pnpm-store"]
105
},
116
"formatter": {
127
"enabled": true,

package.json

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
"name": "tinyws",
33
"version": "0.1.0",
44
"description": "Tiny WebSocket middleware for Node.js based on ws.",
5-
"files": [
6-
"dist"
7-
],
5+
"files": ["dist"],
86
"engines": {
97
"node": ">=12.4"
108
},
@@ -13,27 +11,17 @@
1311
"types": "dist/index.d.ts",
1412
"scripts": {
1513
"build": "tsc -p tsconfig.build.json",
16-
"test": "uvu -r tsm tests",
17-
"test:coverage": "c8 --include=src pnpm test",
18-
"test:report": "c8 report --reporter=text-lcov > coverage.lcov",
19-
"lint": "eslint \"./**/*.ts\"",
20-
"format": "prettier --write \"./**/*.ts\"",
21-
"prepublishOnly": "npm run test && npm run lint && npm run build"
14+
"test": "bun test",
15+
"test:coverage": "bun test --coverage",
16+
"lint": "biome check .",
17+
"format": "biome format --write .",
18+
"prepublishOnly": "bun test && bun run lint && bun run build"
2219
},
2320
"repository": {
2421
"type": "git",
2522
"url": "git+https://github.com/talentlessguy/tinyws.git"
2623
},
27-
"keywords": [
28-
"ws",
29-
"express",
30-
"tinyhttp",
31-
"websocket",
32-
"middleware",
33-
"polka",
34-
"http",
35-
"server"
36-
],
24+
"keywords": ["ws", "express", "tinyhttp", "websocket", "middleware", "polka", "http", "server"],
3725
"author": "v1rtl (https://v1rtl.site)",
3826
"license": "MIT",
3927
"bugs": {

0 commit comments

Comments
 (0)