Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Release to NPM

on:
release:
types: [published]

jobs:
publish:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18.x'
registry-url: 'https://registry.npmjs.org'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Run tests
run: npm test

- name: Publish to NPM
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.5.1] - 2025-09-17

### Changed
- Updated dependencies to latest versions
- No breaking changes

### Added
- GitHub Actions workflow for automated NPM releases
- CI/CD pipeline for quality-gated publishing

## [2.5.0] - 2017-05-03

### Added
- `avoid` option in `Graph#path` - You can now pass an array of nodes to avoid when computing the path
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,15 @@ route.path("A", "D", { cost: true });
- The method `Graph#shortestPath` has been deprecated, use `Graph#path` instead
- The method `Graph#addVertex` has been deprecated, use `Graph#addNode` instead

## Releases

This package uses automated releases to NPM via GitHub Actions. When a new [GitHub release](https://github.com/albertorestifo/node-dijkstra/releases) is published, the package is automatically published to NPM after running the test suite.

To create a new release:
1. Update the version in `package.json`
2. Create a new [GitHub release](https://github.com/albertorestifo/node-dijkstra/releases/new) with a tag matching the version
3. The GitHub Actions workflow will automatically publish to NPM

## Testing

```shell
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "node-dijkstra",
"version": "2.5.0",
"version": "2.5.1",
"description": "A NodeJS implementation of Dijkstra's algorithm",
"author": "Alberto Restifo <alberto.restifo@gmail.com>",
"main": "libs/Graph.js",
Expand Down