Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Publish release fix #8

Open
wants to merge 30 commits into
base: master
Choose a base branch
from
Open
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
54 changes: 31 additions & 23 deletions .github/workflows/release-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,11 @@ name: 'Build and Publish Docker Image'
on:
push:
branches:
- master
pull_request:
branches:
- master
types:
- closed
- 'fix/*'

jobs:
publish-to-npm:
name: Publish to NPM
publish-to-github:
name: Publish to Github
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
Expand All @@ -28,11 +23,16 @@ jobs:
uses: actions/[email protected]
with:
fetch-depth: 0
ref: ${{ github.ref }}
- name: Debug Publish Branch
run: echo "${{ github.ref_name }}"
- run: corepack enable
- uses: actions/[email protected]
with:
node-version: 20.x
cache: 'pnpm'
registry-url: 'https://npm.pkg.github.com'
scope: '@bitovi'
- run: pnpm install --frozen-lockfile

- name: Set release version in env
Expand All @@ -46,50 +46,58 @@ jobs:
with:
path: ./packages/**/dist
key: ${{ github.sha }}-release:build

- name: Dry-run publishing
run: pnpm publish -r --no-git-checks --dry-run

- name: Publish to NPM
- name: Dry Run Publish
run: pnpm publish -r --publish-branch ${{ github.ref_name }} --dry-run
- name: Publish to GitHub Packages
run: |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
echo "@n8n_io:registry=https://npm.pkg.github.com" > .npmrc
echo "@n8n:registry=https://npm.pkg.github.com" >> .npmrc
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> .npmrc
node .github/scripts/trim-fe-packageJson.js
node .github/scripts/ensure-provenance-fields.mjs
sed -i "s/default: 'dev'/default: 'stable'/g" packages/cli/dist/config/schema.js
pnpm publish -r --publish-branch ${{github.event.pull_request.base.ref}} --access public --tag rc --no-git-checks
pnpm publish -r --publish-branch ${{ github.ref_name }} --access public --tag rc --no-git-checks

- name: Debug .npmrc
run: cat .npmrc
- id: set-release
run: echo "release=${{ env.RELEASE }}" >> $GITHUB_OUTPUT

build-and-push:
needs: [publish-to-npm]
needs: [publish-to-github]
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/[email protected]
with:
fetch-depth: 0
ref: ${{ github.ref }}

- name: Set up Docker Buildx
uses: docker/[email protected]

- name: Login to Docker Hub
- name: Login to GitHub Container Registry
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Debugging1
run: ls -R ./docker/images/n8n

- name: Debugging2
run: cat ./docker/images/n8n/Dockerfile

- name: Build and Push Docker Image
uses: docker/[email protected]
with:
context: ./docker/images/n8n
build-args: |
N8N_VERSION=${{ needs.publish-to-npm.outputs.release }}
N8N_VERSION=${{ needs.publish-to-github.outputs.release }}
platforms: linux/amd64,linux/arm64
provenance: false
push: true
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/n8n:${{ needs.publish-to-npm.outputs.release }}
docker.io/${{ github.repository_owner }}/n8n:${{ needs.publish-to-npm.outputs.release }}
ghcr.io/${{ github.repository_owner }}/n8n:${{ needs.publish-to-github.outputs.release }}

7 changes: 7 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
{
"name": "n8n-monorepo",
"repository": {
"type": "git",
"url": "https://github.com/bitovi/n8n.git"
},
"publishConfig": {
"registry": "https://npm.pkg.github.com/"
},
"version": "1.73.0",
"private": true,
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion packages/@n8n/nodes-langchain/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@n8n/n8n-nodes-langchain",
"version": "1.73.0",
"version": "1.73.1",
"description": "",
"main": "index.js",
"scripts": {
Expand Down
Loading