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
2 changes: 0 additions & 2 deletions .github/workflows/nodejs-pgsql14.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ jobs:
npm run build
- name: Test
run: npm test
env:
POSTGRES_PORT: 5432
- uses: phoenix-actions/test-reporting@v8
if: success() || failure()
id: test-report
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/nodejs-pgsql15.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ jobs:
npm run build
- name: Test
run: npm test
env:
POSTGRES_PORT: 5432
- uses: phoenix-actions/test-reporting@v8
if: success() || failure()
id: test-report
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/nodejs-pgsql16.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ jobs:
npm run build
- name: Test
run: npm test
env:
POSTGRES_PORT: 5432
- uses: phoenix-actions/test-reporting@v8
if: success() || failure()
id: test-report
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/nodejs-pgsql17.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ jobs:
npm run build
- name: Test
run: npm test
env:
POSTGRES_PORT: 5432
- uses: phoenix-actions/test-reporting@v8
if: success() || failure()
id: test-report
Expand Down
75 changes: 30 additions & 45 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,15 @@
name: Manual NPM Release
name: NPM Release on PR Merge

on:
workflow_dispatch:
inputs:
version_type:
description: 'Version bump type'
required: true
default: 'patch'
type: choice
options:
- patch
- minor
- major
dry_run:
description: 'Dry run (test without publishing)'
required: false
default: false
type: boolean
pull_request:
types: [closed]
branches: [main]

jobs:
release:
if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'release')
runs-on: ubuntu-latest
environment: github action

services:
postgres:
Expand All @@ -35,8 +24,6 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Setup Node.js
uses: actions/setup-node@v4
Expand All @@ -47,40 +34,38 @@ jobs:
- name: Install dependencies
run: npm ci

- name: Configure git
- name: Get package version
id: package_version
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"

- name: Bump version and create tag
id: version_bump
run: |
if [ "${{ github.event.inputs.dry_run }}" = "true" ]; then
echo "🧪 DRY RUN MODE"
NEW_VERSION=$(npm version ${{ github.event.inputs.version_type }} --no-git-tag-version)
echo "Would bump to version: $NEW_VERSION"
git checkout -- package.json package-lock.json
else
NEW_VERSION=$(npm version ${{ github.event.inputs.version_type }})
echo "version=$NEW_VERSION" >> $GITHUB_OUTPUT
git push origin main --follow-tags
fi
VERSION=$(node -p "require('./package.json').version")
echo "version=$VERSION" >> $GITHUB_OUTPUT

- name: Run tests
env:
POSTGRES_PORT: 5432
run: npm test

- name: Build
run: npm run build

- name: Publish to NPM
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Create tag
run: |
if [ "${{ github.event.inputs.dry_run }}" = "true" ]; then
echo "🧪 DRY RUN: Would publish to NPM"
npm publish --access public --dry-run
else
npm publish --access public
fi
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git tag "v${{ steps.package_version.outputs.version }}"
git push origin "v${{ steps.package_version.outputs.version }}"
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create GitHub Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: "v${{ steps.package_version.outputs.version }}"
release_name: Release "v${{ steps.package_version.outputs.version }}"
draft: false
prerelease: false
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pg-logical-replication",
"version": "2.1.0",
"version": "2.1.1",
"description": "PostgreSQL Location Replication client - logical WAL replication streaming",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion src/test/client-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { ClientConfig } from 'pg';
// infra/docker-pg-logical-replication/docker-compose.yml
export const TestClientConfig: ClientConfig = {
host: process.env.POSTGRES_HOST || 'localhost',
port: Number(process.env.POSTGRES_PORT || 54320),
port: Number(process.env.POSTGRES_PORT || 5432),
user: 'postgres',
password: 'postgrespw',
database: 'playground',
Expand Down
Loading