From 170796f254e2309c24d6bec57edc93860ea84b6f Mon Sep 17 00:00:00 2001 From: Elias Meire Date: Wed, 17 Sep 2025 14:09:55 +0200 Subject: [PATCH] ci: Add GitHub action to release @n8n/node-cli (#19644) --- .github/workflows/release-node-cli.yml | 44 ++++++++++++++++++++++++++ .github/workflows/release-publish.yml | 11 +++++-- 2 files changed, 52 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/release-node-cli.yml diff --git a/.github/workflows/release-node-cli.yml b/.github/workflows/release-node-cli.yml new file mode 100644 index 0000000000..91895b0bb8 --- /dev/null +++ b/.github/workflows/release-node-cli.yml @@ -0,0 +1,44 @@ +name: 'Release: Node CLI Tools' + +on: + push: + branches: + - master + paths: + - 'packages/@n8n/node-cli/package.json' + - 'packages/@n8n/create-node/package.json' + workflow_dispatch: + +concurrency: + group: release-node-cli + cancel-in-progress: false + +jobs: + release: + runs-on: blacksmith-4vcpu-ubuntu-2204 + timeout-minutes: 15 + permissions: + id-token: write + env: + NPM_CONFIG_PROVENANCE: true + + steps: + - name: Checkout + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + fetch-depth: 0 + + - name: Setup Environment + uses: ./.github/actions/setup-nodejs-blacksmith + with: + build-command: 'pnpm --filter "@n8n/node-cli" --filter "@n8n/create-node" build' + + - name: Pre publishing changes + run: | + echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc + node .github/scripts/ensure-provenance-fields.mjs + + - name: Publish packages + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + run: pnpm --filter "@n8n/node-cli" --filter "@n8n/create-node" publish --access public --no-git-checks --publish-branch master diff --git a/.github/workflows/release-publish.yml b/.github/workflows/release-publish.yml index 28495ac420..451cffda5d 100644 --- a/.github/workflows/release-publish.yml +++ b/.github/workflows/release-publish.yml @@ -81,7 +81,9 @@ jobs: key: ${{ env.BUILD_CACHE_KEY }} - name: Dry-run publishing - run: pnpm publish -r --no-git-checks --dry-run + run: | + pnpm --filter n8n publish --no-git-checks --dry-run + pnpm publish -r --filter '!n8n' --no-git-checks --dry-run - name: Pre publishing changes run: | @@ -91,8 +93,11 @@ jobs: cp README.md packages/cli/README.md sed -i "s/default: 'dev'/default: 'stable'/g" packages/cli/dist/config/schema.js - - name: Publish to NPM - run: pnpm publish -r --publish-branch ${{github.event.pull_request.base.ref}} --access public --tag rc --no-git-checks + - name: Publish n8n to NPM with rc tag + run: pnpm --filter n8n publish --publish-branch ${{github.event.pull_request.base.ref}} --access public --tag rc --no-git-checks + + - name: Publish other packages to NPM with latest tag + run: pnpm publish -r --filter '!n8n' --publish-branch ${{github.event.pull_request.base.ref}} --access public --no-git-checks - name: Cleanup rc tag run: npm dist-tag rm n8n rc