Skip to content

Commit 968ede8

Browse files
authored
Merge pull request #65 from chaijs/workflows
chore: add github workflows
2 parents c9b7e6d + fc4be74 commit 968ede8

File tree

4 files changed

+71
-1
lines changed

4 files changed

+71
-1
lines changed

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
open_collective: chaijs

.github/workflows/ci.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
push:
8+
branches:
9+
- master
10+
11+
jobs:
12+
build:
13+
name: Test on node ${{ matrix.node-version }}
14+
runs-on: ubuntu-latest
15+
strategy:
16+
matrix:
17+
node-version:
18+
- 18
19+
- 20
20+
- latest
21+
22+
steps:
23+
- uses: actions/checkout@v4
24+
- name: Use Node.js ${{ matrix.node-version }}
25+
uses: actions/setup-node@v4
26+
with:
27+
node-version: ${{ matrix.node-version }}
28+
- run: npm ci
29+
- run: npm run lint
30+
- run: npm run build --if-present
31+
- run: npm run test

.github/workflows/publish.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Publish to npm
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
- uses: actions/setup-node@v4
13+
with:
14+
node-version: 22
15+
- run: npm ci
16+
- run: npm run build --if-present
17+
- run: npm test
18+
19+
publish-npm:
20+
needs: build
21+
runs-on: ubuntu-latest
22+
permissions:
23+
id-token: write
24+
steps:
25+
- uses: actions/checkout@v4
26+
- uses: actions/setup-node@v4
27+
with:
28+
node-version: 22.x
29+
registry-url: "https://registry.npmjs.org"
30+
cache: "npm"
31+
- run: npm ci
32+
- run: npm run build --if-present
33+
- run: npm version ${TAG_NAME} --git-tag-version=false
34+
env:
35+
TAG_NAME: ${{ github.ref_name }}
36+
- run: npm publish --provenance --access public
37+
env:
38+
NODE_AUTH_TOKEN: ${{ secrets.npm_secret }}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "pathval",
33
"description": "Object value retrieval given a string path",
44
"homepage": "https://github.com/chaijs/pathval",
5-
"version": "2.0.0",
5+
"version": "0.0.0-dev",
66
"keywords": [
77
"pathval",
88
"value retrieval",

0 commit comments

Comments
 (0)