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
51 changes: 17 additions & 34 deletions .github/workflows/generator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,21 @@ jobs:
if: github.event_name == 'push'
runs-on: ubuntu-latest
outputs:
generator_changed: ${{ steps.check.outputs.changed }}
should_publish: ${{ steps.check.outputs.should_publish }}
version: ${{ steps.check.outputs.version }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check for generator/parser changes
- uses: actions/setup-node@v4
with:
node-version: 20.20.2
- name: Check generator release (changelog-driven)
id: check
run: |
CHANGED=$(git diff --name-only HEAD~1 HEAD -- packages/generator/ packages/openapi-parser/ | grep -q . && echo true || echo false)
echo "changed=$CHANGED" >> $GITHUB_OUTPUT
run: node scripts/check-release.mjs --product generator --npm @pachca/generator --dir "packages/generator,packages/openapi-parser" >> "$GITHUB_OUTPUT"

publish-generator:
if: github.event_name == 'push' && needs.check-changes.outputs.generator_changed == 'true'
if: github.event_name == 'push' && needs.check-changes.outputs.should_publish == 'true'
needs: [snapshot-tests, check-changes]
runs-on: ubuntu-latest
concurrency:
Expand Down Expand Up @@ -88,40 +90,21 @@ jobs:
working-directory: packages/generator
run: bun run build

- name: Set version (auto-increment patch)
id: version
- name: Set version (from releases.json)
working-directory: packages/generator
run: |
VERSION=$(node -e "
const { execSync } = require('child_process');
const base = require('./package.json').version.split('.').slice(0, 2).join('.');
let versions = [];
try {
const raw = execSync('npm view @pachca/generator versions --json', { stdio: ['pipe', 'pipe', 'pipe'] }).toString().trim();
const parsed = JSON.parse(raw);
versions = Array.isArray(parsed) ? parsed : [parsed];
} catch {}
const matching = versions.filter(v => v.startsWith(base + '.'));
const lastPatch = matching.length > 0
? Math.max(...matching.map(v => parseInt(v.split('.')[2])))
: -1;
console.log(base + '.' + (lastPatch + 1));
")
echo "version=$VERSION" >> $GITHUB_OUTPUT
VERSION="${{ needs.check-changes.outputs.version }}"
node -e "const fs=require('fs'),p=JSON.parse(fs.readFileSync('package.json'));p.version='$VERSION';fs.writeFileSync('package.json',JSON.stringify(p,null,2)+'\n')"
echo "Publishing @pachca/generator@$VERSION"

- name: Publish to npm
- name: Publish to npm (idempotent)
working-directory: packages/generator
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
OUTPUT=$(npm publish --access public --provenance 2>&1) || {
CODE=$?
if echo "$OUTPUT" | grep -q "E409\|already exists"; then
echo "Version ${{ steps.version.outputs.version }} already published, skipping"
else
echo "$OUTPUT"
exit $CODE
fi
}
VERSION="${{ needs.check-changes.outputs.version }}"
if npm view "@pachca/generator@${VERSION}" version 2>/dev/null; then
echo "@pachca/generator@${VERSION} already published, skipping"
else
npm publish --access public --provenance
fi
82 changes: 27 additions & 55 deletions .github/workflows/n8n.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,83 +116,55 @@ jobs:
- name: Generate n8n node
run: bun run integrations/n8n/scripts/generate-n8n.ts

- name: Check for publishable changes
- name: Check n8n release (changelog-driven)
id: changes
run: |
# workflow_dispatch always publishes (manual trigger = intentional)
OUT=$(node scripts/check-release.mjs --product n8n --npm n8n-nodes-pachca \
--dir integrations/n8n --changelog integrations/n8n/CHANGELOG.md --changelog-type md)
VERSION=$(echo "$OUT" | grep '^version=' | cut -d= -f2)
SHOULD=$(echo "$OUT" | grep '^should_publish=' | cut -d= -f2)
# Manual dispatch forces a publish of the declared version.
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo "changed=true" >> $GITHUB_OUTPUT
echo "Manual dispatch — forcing publish"
exit 0
fi
# Check committed source changes (exclude tests, scripts, docs, config)
COMMITTED=$(git diff --name-only HEAD~1 HEAD -- integrations/n8n/ \
| grep -v -E '^integrations/n8n/(tests/|scripts/|docs/|e2e/|eslint|tsconfig|\.gitignore|\.npmrc|vitest)' \
| grep -q . && echo true || echo false)
# Check if generation produced different files (spec/generator changed)
GENERATED=$(git diff --name-only -- integrations/n8n/nodes/ integrations/n8n/credentials/ \
| grep -q . && echo true || echo false)
if [ "$COMMITTED" = "true" ] || [ "$GENERATED" = "true" ]; then
echo "changed=true" >> $GITHUB_OUTPUT
echo "Publishable changes detected (committed=$COMMITTED, generated=$GENERATED)"
else
echo "changed=false" >> $GITHUB_OUTPUT
echo "No publishable changes, skipping publish"
echo "Manual dispatch — forcing publish of $VERSION"
SHOULD=true
fi
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
echo "should_publish=$SHOULD" >> "$GITHUB_OUTPUT"

- name: Set version (auto-increment patch)
if: steps.changes.outputs.changed == 'true'
id: version
- name: Set version (from releases.json)
if: steps.changes.outputs.should_publish == 'true'
working-directory: integrations/n8n
run: |
VERSION=$(node -e "
const { execSync } = require('child_process');
const base = require('./package.json').version.split('.').slice(0, 2).join('.');
let versions = [];
try {
const raw = execSync('npm view n8n-nodes-pachca versions --json', { stdio: ['pipe', 'pipe', 'pipe'] }).toString().trim();
const parsed = JSON.parse(raw);
versions = Array.isArray(parsed) ? parsed : [parsed];
} catch {}
const matching = versions.filter(v => v.startsWith(base + '.'));
const lastPatch = matching.length > 0
? Math.max(...matching.map(v => parseInt(v.split('.')[2])))
: -1;
console.log(base + '.' + (lastPatch + 1));
")
echo "version=$VERSION" >> $GITHUB_OUTPUT
VERSION="${{ steps.changes.outputs.version }}"
node -e "const fs=require('fs'),p=JSON.parse(fs.readFileSync('package.json'));p.version='$VERSION';fs.writeFileSync('package.json',JSON.stringify(p,null,2)+'\n')"
echo "Publishing n8n-nodes-pachca@$VERSION"

- name: Build n8n node
if: steps.changes.outputs.changed == 'true'
if: steps.changes.outputs.should_publish == 'true'
working-directory: integrations/n8n
run: |
bun run tsc
find nodes icons credentials \( -name '*.png' -o -name '*.svg' \) | while read f; do mkdir -p "dist/$(dirname "$f")" && cp "$f" "dist/$f"; done

- name: Publish to npm
if: steps.changes.outputs.changed == 'true'
- name: Publish to npm (idempotent)
if: steps.changes.outputs.should_publish == 'true'
working-directory: integrations/n8n
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
OUTPUT=$(npm publish --access public --provenance --ignore-scripts 2>&1) || {
CODE=$?
if echo "$OUTPUT" | grep -q "E409\|already exists"; then
echo "Version ${{ steps.version.outputs.version }} already published, skipping"
else
echo "$OUTPUT"
exit $CODE
fi
}
VERSION="${{ steps.changes.outputs.version }}"
if npm view "n8n-nodes-pachca@${VERSION}" version 2>/dev/null; then
echo "n8n-nodes-pachca@${VERSION} already published, skipping"
else
npm publish --access public --provenance --ignore-scripts
fi

- name: Scan community package
if: steps.changes.outputs.changed == 'true'
run: npx @n8n/scan-community-package n8n-nodes-pachca@${{ steps.version.outputs.version }}
if: steps.changes.outputs.should_publish == 'true'
run: npx @n8n/scan-community-package n8n-nodes-pachca@${{ steps.changes.outputs.version }}

- name: Create GitHub Release
if: steps.changes.outputs.changed == 'true'
if: steps.changes.outputs.should_publish == 'true'
working-directory: integrations/n8n
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -202,8 +174,8 @@ jobs:
tar -xzf n8n-nodes-pachca-*.tgz --strip-components=1 -C n8n-nodes-pachca
rm n8n-nodes-pachca-*.tgz
tar -czf n8n-nodes-pachca.tgz n8n-nodes-pachca
gh release create "n8n-v${{ steps.version.outputs.version }}" \
gh release create "n8n-v${{ steps.changes.outputs.version }}" \
n8n-nodes-pachca.tgz \
--title "n8n-nodes-pachca v${{ steps.version.outputs.version }}" \
--title "n8n-nodes-pachca v${{ steps.changes.outputs.version }}" \
--notes "See [CHANGELOG](integrations/n8n/CHANGELOG.md) for details." \
--latest
66 changes: 18 additions & 48 deletions .github/workflows/sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ jobs:
python_changed: ${{ steps.sdk_changes.outputs.python_changed }}
csharp_changed: ${{ steps.sdk_changes.outputs.csharp_changed }}
swift_changed: ${{ steps.sdk_changes.outputs.swift_changed }}
cli_changed: ${{ steps.cli_check.outputs.changed }}
cli_should_publish: ${{ steps.cli_check.outputs.should_publish }}
cli_version: ${{ steps.cli_check.outputs.version }}
steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -76,21 +77,10 @@ jobs:
echo "any_changed=false" >> $GITHUB_OUTPUT
fi

- name: Check for CLI changes
- name: Check CLI release (changelog-driven)
if: github.event_name == 'push'
id: cli_check
run: |
PREV_TAG=$(git describe --tags --abbrev=0 HEAD~1 2>/dev/null || echo "")
if [ -n "$PREV_TAG" ]; then
CHANGED=$(git diff --name-only "$PREV_TAG" HEAD -- packages/cli/ | grep -v '^packages/cli/scripts/' | grep -q . && echo true || echo false)
else
CHANGED=$(git diff --name-only HEAD~1 HEAD -- packages/cli/ | grep -v '^packages/cli/scripts/' | grep -q . && echo true || echo false)
fi
# Also check uncommitted changes from generate
if git diff --name-only -- packages/cli/ | grep -v '^packages/cli/scripts/' | grep -q .; then
CHANGED=true
fi
echo "changed=$CHANGED" >> $GITHUB_OUTPUT
run: node scripts/check-release.mjs --product cli --npm @pachca/cli --dir packages/cli --changelog packages/cli/src/data/changelog.json --changelog-type json --version-rule calver >> "$GITHUB_OUTPUT"

- name: Build TypeScript SDK
if: github.event_name != 'pull_request' || steps.sdk_changes.outputs.ts_changed == 'true'
Expand Down Expand Up @@ -231,7 +221,7 @@ jobs:
fi

publish-cli:
if: github.event_name == 'push' && needs.generate-and-build.outputs.cli_changed == 'true'
if: github.event_name == 'push' && needs.generate-and-build.outputs.cli_should_publish == 'true'
needs: generate-and-build
runs-on: ubuntu-latest
concurrency:
Expand All @@ -252,46 +242,26 @@ jobs:
node-version: 20.20.2
registry-url: "https://registry.npmjs.org"
- run: bun install --frozen-lockfile
- name: Set CLI version (CalVer YYYY.M.patch)
id: version
- name: Set CLI version (from changelog/releases.json)
run: |
VERSION=$(node -e "
const { execSync } = require('child_process');
const d = new Date();
const base = d.getFullYear() + '.' + (d.getMonth()+1);
let versions = [];
try {
const raw = execSync('npm view @pachca/cli versions --json', { stdio: ['pipe', 'pipe', 'pipe'] }).toString().trim();
const parsed = JSON.parse(raw);
versions = Array.isArray(parsed) ? parsed : [parsed];
} catch {}
const patch = versions.filter(v => v.startsWith(base + '.')).length;
console.log(base + '.' + patch);
")
echo "version=$VERSION" >> $GITHUB_OUTPUT
# Version comes from the release gate (top of changelog.json /
# releases.json), not an npm auto-bump. CHANGELOG.md is rendered from
# changelog.json by patch-manifest.js during build.
VERSION="${{ needs.generate-and-build.outputs.cli_version }}"
cd packages/cli && node -e "const fs=require('fs'),p=JSON.parse(fs.readFileSync('package.json'));p.version='$VERSION';fs.writeFileSync('package.json',JSON.stringify(p,null,2)+'\n')"
- name: Generate changelog
run: bun scripts/diff-endpoints.ts
working-directory: packages/cli
- run: bun run build
working-directory: packages/cli
- working-directory: packages/cli
- name: Publish to npm (idempotent)
working-directory: packages/cli
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
OUTPUT=$(npm publish --access public --provenance 2>&1) || {
CODE=$?
if echo "$OUTPUT" | grep -q "E409\|already exists"; then
CURRENT=$(node -e "console.log(require('./package.json').version)")
PATCH=$(echo $CURRENT | cut -d. -f3)
BASE=$(echo $CURRENT | cut -d. -f1-2)
node -e "const fs=require('fs'),p=JSON.parse(fs.readFileSync('package.json'));p.version='${BASE}.$((PATCH+1))';fs.writeFileSync('package.json',JSON.stringify(p,null,2)+'\n')"
npm publish --access public --provenance
else
echo "$OUTPUT"
exit $CODE
fi
}
VERSION="${{ needs.generate-and-build.outputs.cli_version }}"
if npm view "@pachca/cli@${VERSION}" version 2>/dev/null; then
echo "@pachca/cli@${VERSION} already published, skipping"
else
npm publish --access public --provenance
fi

publish-py:
if: github.event_name == 'push' && needs.generate-and-build.outputs.python_changed == 'true'
Expand Down
12 changes: 12 additions & 0 deletions apps/docs/data/releases.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
[
{
"product": "cli",
"version": "2026.5.6",
"date": "2026-05-21",
"changes": [
{
"type": "~",
"command": "api",
"description": "В выводе `pachca api <МЕТОД> <путь> --describe` у полей запроса и ответа появились примеры значений"
}
]
},
{
"product": "n8n",
"version": "2.0.9",
Expand Down
11 changes: 11 additions & 0 deletions packages/cli/src/data/changelog.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
[
{
"version": "2026.5.6",
"date": "21 мая 2026",
"changes": [
{
"type": "~",
"command": "api",
"description": "В выводе `pachca api <МЕТОД> <путь> --describe` у полей запроса и ответа появились примеры значений"
}
]
},
{
"version": "2026.5.4",
"date": "20 мая 2026",
Expand Down
Loading
Loading