diff --git a/.github/workflows/publish-alpha.yaml b/.github/workflows/publish-alpha.yaml index ccd647c..c65653a 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: @@ -6,30 +6,30 @@ on: - 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 diff --git a/.github/workflows/publish-stable.yaml b/.github/workflows/publish-stable.yaml index 29bf896..548a6f0 100644 --- a/.github/workflows/publish-stable.yaml +++ b/.github/workflows/publish-stable.yaml @@ -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 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",