Skip to content

Commit 30ab86e

Browse files
committed
feat: Add and split npm actions, refactor test dir
1 parent 5cb5898 commit 30ab86e

File tree

7 files changed

+66
-33
lines changed

7 files changed

+66
-33
lines changed

.github/workflows/dockerhub.yml renamed to .github/workflows/dockerhub-build-publish.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
name: Build and publish Docker image
22

33
on:
4-
push:
5-
tags:
6-
- '*.*.*'
4+
release:
5+
types: [published]
76

87
jobs:
98
docker-build-and-publish:
@@ -25,7 +24,7 @@ jobs:
2524
type=semver,pattern={{version}}
2625
type=semver,pattern={{major}}.{{minor}}
2726
type=semver,pattern={{major}}
28-
- name: Checkout
27+
- name: Checkout code
2928
uses: actions/checkout@v5
3029

3130
- name: Login to Docker Hub
@@ -46,4 +45,4 @@ jobs:
4645
context: .
4746
platforms: linux/amd64,linux/arm64
4847
push: true
49-
tags: ${{ steps.meta.outputs.tags }}
48+
tags: ${{ steps.meta.outputs.tags }}

.github/workflows/npm-build.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Build on Pull Request
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
push:
7+
branches: [main]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
node-version: [24.x]
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v5
20+
21+
- name: Setup Node.js ${{ matrix.node-version }}
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: ${{ matrix.node-version }}
25+
cache: 'npm'
26+
27+
- name: Install dependencies
28+
run: npm ci
29+
30+
- name: Run tests
31+
run: npm test

.github/workflows/npm-publish.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Publish Package to npmjs
2+
on:
3+
release:
4+
types: [published]
5+
jobs:
6+
build-and-publish:
7+
environment:
8+
name: npm-bmssp
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: read
12+
id-token: write
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v5
16+
- name: Setup Node.js ${{ matrix.node-version }}
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: ${{ matrix.node-version }}
20+
cache: 'npm'
21+
registry-url: 'https://registry.npmjs.org'
22+
- name: Install dependencies
23+
run: npm ci
24+
- name: Publish package
25+
run: npm publish --provenance --access public
26+
env:
27+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/npmjs.yml

Lines changed: 0 additions & 24 deletions
This file was deleted.

package-lock.json

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

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "bmssp",
3-
"version": "0.5.0",
3+
"version": "0.6.0",
44
"description": "Javascript package implementation of the bmssp algorithm.",
55
"keywords": [
66
"shortest-paths",
@@ -24,6 +24,6 @@
2424
"doc": "docs"
2525
},
2626
"scripts": {
27-
"test": "node tests/main.js"
27+
"test": "node test/main.js"
2828
}
2929
}
File renamed without changes.

0 commit comments

Comments
 (0)