From 463680c2dabafa4fb738f12cc3a5f37d52d70293 Mon Sep 17 00:00:00 2001 From: Rana Salem Date: Fri, 11 Jul 2025 09:43:50 +0100 Subject: [PATCH 1/6] fix publish-alpha workflow --- .github/workflows/publish-alpha.yaml | 24 +++++++++++------------- .github/workflows/publish-stable.yaml | 7 +------ README.md | 12 ++++++++---- package.json | 2 +- 4 files changed, 21 insertions(+), 24 deletions(-) diff --git a/.github/workflows/publish-alpha.yaml b/.github/workflows/publish-alpha.yaml index ccd647c..6aa47ff 100644 --- a/.github/workflows/publish-alpha.yaml +++ b/.github/workflows/publish-alpha.yaml @@ -1,4 +1,4 @@ -name: NPM Publish Alpha Version +name: NPM Publish Alpha on: push: @@ -8,28 +8,26 @@ on: jobs: publish: 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" + node-version: 'lts/*' + cache: 'npm' - run: npm ci - - name: Bump version (alpha) + - name: Increment version 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=$(date +'%Y-%m-%d-%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 diff --git a/.github/workflows/publish-stable.yaml b/.github/workflows/publish-stable.yaml index 29bf896..74805cf 100644 --- a/.github/workflows/publish-stable.yaml +++ b/.github/workflows/publish-stable.yaml @@ -1,4 +1,4 @@ -name: NPM Publish Stable Version +name: NPM Publish Stable on: pull_request: @@ -26,11 +26,6 @@ jobs: with: node-version: ${{ matrix.node-version }} - run: npm ci - - - name: Bump Version to NPM - run: | - npx standard-version - echo "New version: $(node -p "require('./package.json').version")" - name: Authenticate to NPM run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_ACCESS_TOKEN }}" > ~/.npmrc diff --git a/README.md b/README.md index 9897831..66bbe2b 100644 --- a/README.md +++ b/README.md @@ -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: @@ -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 @@ -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 diff --git a/package.json b/package.json index bf56792..0e5d07b 100644 --- a/package.json +++ b/package.json @@ -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", From 91d81b6a4f3a40c14bf00d4d7631b2b63e34e17d Mon Sep 17 00:00:00 2001 From: Rana Salem Date: Fri, 11 Jul 2025 09:50:13 +0100 Subject: [PATCH 2/6] update alpha workflow --- .github/workflows/publish-alpha.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish-alpha.yaml b/.github/workflows/publish-alpha.yaml index 6aa47ff..3f708c2 100644 --- a/.github/workflows/publish-alpha.yaml +++ b/.github/workflows/publish-alpha.yaml @@ -17,9 +17,11 @@ jobs: with: node-version: 'lts/*' cache: 'npm' - - run: npm ci - - name: Increment version + - name: Clean install dependencies + run: npm ci + + - name: Increment version with alpha tag run: | BRANCH_NAME=${GITHUB_REF##*/} CURRENT_VERSION=$(node -p "require('./package.json').version") From 5dc13b0de614e97fcb3bbf5838445006d5721a44 Mon Sep 17 00:00:00 2001 From: Rana Salem Date: Fri, 11 Jul 2025 10:03:12 +0100 Subject: [PATCH 3/6] tidy up stable workflow --- .github/workflows/publish-stable.yaml | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/.github/workflows/publish-stable.yaml b/.github/workflows/publish-stable.yaml index 74805cf..236704b 100644 --- a/.github/workflows/publish-stable.yaml +++ b/.github/workflows/publish-stable.yaml @@ -1,31 +1,24 @@ name: NPM Publish Stable on: - pull_request: - types: - - closed + push: branches: - main jobs: publish: 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: Clean install dependencies + run: npm ci - name: Authenticate to NPM run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_ACCESS_TOKEN }}" > ~/.npmrc From a27b392668e99d9a517fa092254a3267d93e0bd7 Mon Sep 17 00:00:00 2001 From: Rana Salem Date: Fri, 11 Jul 2025 10:05:10 +0100 Subject: [PATCH 4/6] set timezone for alpha tag --- .github/workflows/publish-alpha.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-alpha.yaml b/.github/workflows/publish-alpha.yaml index 3f708c2..4c8c776 100644 --- a/.github/workflows/publish-alpha.yaml +++ b/.github/workflows/publish-alpha.yaml @@ -26,7 +26,7 @@ jobs: BRANCH_NAME=${GITHUB_REF##*/} CURRENT_VERSION=$(node -p "require('./package.json').version") SANITISED_BRANCH_NAME=$(echo "$BRANCH_NAME" | tr '/' '-') - TIMESTAMP=$(date +'%Y-%m-%d-%H%M%S') + TIMESTAMP=$(TZ='Europe/London' date +'%Y-%m-%d-%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" From 69687d8b6f1db4cab1908c2b88dfd0f787172784 Mon Sep 17 00:00:00 2001 From: Rana Salem Date: Fri, 11 Jul 2025 10:06:29 +0100 Subject: [PATCH 5/6] update workflow job names --- .github/workflows/publish-alpha.yaml | 4 ++-- .github/workflows/publish-stable.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish-alpha.yaml b/.github/workflows/publish-alpha.yaml index 4c8c776..412933d 100644 --- a/.github/workflows/publish-alpha.yaml +++ b/.github/workflows/publish-alpha.yaml @@ -6,7 +6,7 @@ on: - main jobs: - publish: + publish-alpha: runs-on: ubuntu-latest steps: @@ -26,7 +26,7 @@ jobs: BRANCH_NAME=${GITHUB_REF##*/} CURRENT_VERSION=$(node -p "require('./package.json').version") SANITISED_BRANCH_NAME=$(echo "$BRANCH_NAME" | tr '/' '-') - TIMESTAMP=$(TZ='Europe/London' date +'%Y-%m-%d-%H%M%S') + 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" diff --git a/.github/workflows/publish-stable.yaml b/.github/workflows/publish-stable.yaml index 236704b..40bb116 100644 --- a/.github/workflows/publish-stable.yaml +++ b/.github/workflows/publish-stable.yaml @@ -6,7 +6,7 @@ on: - main jobs: - publish: + publish-stable: runs-on: ubuntu-latest steps: From fff64a8886da20b363cc02d3f7ef2293d090a83d Mon Sep 17 00:00:00 2001 From: Rana Salem Date: Fri, 11 Jul 2025 10:07:48 +0100 Subject: [PATCH 6/6] update workflow job names --- .github/workflows/publish-alpha.yaml | 2 +- .github/workflows/publish-stable.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish-alpha.yaml b/.github/workflows/publish-alpha.yaml index 412933d..c65653a 100644 --- a/.github/workflows/publish-alpha.yaml +++ b/.github/workflows/publish-alpha.yaml @@ -6,7 +6,7 @@ on: - main jobs: - publish-alpha: + npm-publish-alpha: runs-on: ubuntu-latest steps: diff --git a/.github/workflows/publish-stable.yaml b/.github/workflows/publish-stable.yaml index 40bb116..548a6f0 100644 --- a/.github/workflows/publish-stable.yaml +++ b/.github/workflows/publish-stable.yaml @@ -6,7 +6,7 @@ on: - main jobs: - publish-stable: + npm-publish-stable: runs-on: ubuntu-latest steps: