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
30 changes: 15 additions & 15 deletions .github/workflows/publish-alpha.yaml
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
name: NPM Publish Alpha Version
name: NPM Publish Alpha

on:
push:
branches-ignore:
- main

jobs:
publish:
npm-publish-alpha:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [22.x]

steps:
- uses: actions/checkout@v4

- name: Use Node.js LTS
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
- run: npm ci
node-version: 'lts/*'
cache: 'npm'

- name: Clean install dependencies
run: npm ci

- name: Bump version (alpha)
- name: Increment version with alpha tag
run: |
BRANCH_NAME=${GITHUB_REF##*/}
if [ "$BRANCH_NAME" != "main" ]; then
CURRENT_VERSION=$(node -p "require('./package.json').version")
ALPHA_VERSION="${CURRENT_VERSION}-alpha.$(date +%s)"
npm version --no-git-tag-version $ALPHA_VERSION
echo "Alpha version: $ALPHA_VERSION"
fi
CURRENT_VERSION=$(node -p "require('./package.json').version")
SANITISED_BRANCH_NAME=$(echo "$BRANCH_NAME" | tr '/' '-')
TIMESTAMP=$(TZ='Europe/London' date +'%d-%m-%Y-%H%M%S')
ALPHA_VERSION="${CURRENT_VERSION}-alpha.${SANITISED_BRANCH_NAME}.${TIMESTAMP}"
npm version --no-git-tag-version $ALPHA_VERSION
echo "Alpha version: $ALPHA_VERSION"

- name: Authenticate to NPM
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_ACCESS_TOKEN }}" > ~/.npmrc
Expand Down
26 changes: 7 additions & 19 deletions .github/workflows/publish-stable.yaml
Original file line number Diff line number Diff line change
@@ -1,36 +1,24 @@
name: NPM Publish Stable Version
name: NPM Publish Stable

on:
pull_request:
types:
- closed
push:
branches:
- main

jobs:
publish:
npm-publish-stable:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]

steps:
- uses: actions/checkout@v4

- name: Set up Git User
run: |
git config --global user.email "github-actions@github.com"
git config --global user.name "GitHub Actions"

- name: Use Node.js LTS
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
node-version: 'lts/*'

- name: Bump Version to NPM
run: |
npx standard-version
echo "New version: $(node -p "require('./package.json').version")"
- name: Clean install dependencies
run: npm ci

- name: Authenticate to NPM
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_ACCESS_TOKEN }}" > ~/.npmrc
Expand Down
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ Service BUS + PostGRES = Busgres

[Busgres](https://www.npmjs.com/package/busgres) is a Node.js package that will receive a message from an Azure Service Bus queue or topic and save it into a PostgreSQL database. It abstracts the [`@azure/service-bus`](https://www.npmjs.com/package/@azure/service-bus) and [`pg` (node-postgres)](https://www.npmjs.com/package/pg) packages for Service Bus and Postgres integration.

## Note

For the best experience, use only Busgres `v5.0.3` and above.

## Installation

This package can be installed using NPM:
Expand Down Expand Up @@ -67,11 +71,11 @@ With the above set-up and configuration a basic working `BusgresClient` connecti

## Demo

A simple demo Node.js application, [busgres-demo](https://github.com/rtasalem/busgres-demo) was created to test the functionality of this package during its development and to provide further example of usage.
A simple demo Node.js application, [busgres-demo](https://github.com/rtasalem/busgres-demo), was created to test the functionality of this package during its development and to provide further example of usage.

## License

This package is licensed under the MIT License. Refer to the [LICENSE](https://github.com/rtasalem/busgres/blob/main/LICENSE) file for more details.
This package is licensed under the [MIT License](./LICENSE).

## Feedback

Expand All @@ -80,8 +84,8 @@ Feel free to reach out if you have any suggestions for improvement or further de
## Dependencies

This package has a total of 2 dependencies on the following:
[@azure/service-bus](https://www.npmjs.com/package/@azure/service-bus)
[pg](https://www.npmjs.com/package/pg)
- [@azure/service-bus](https://www.npmjs.com/package/@azure/service-bus)
- [pg](https://www.npmjs.com/package/pg)

## Author

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": "busgres",
"version": "5.0.2",
"version": "5.0.4",
"description": "Busgres is an NPM package for receiving messages from Service Bus and saving them into a PostgreSQL database.",
"main": "index.js",
"type": "module",
Expand Down