chore: remove unused actions and scripts

Signed-off-by: mertmit <mertmit99@gmail.com>
This commit is contained in:
mertmit committed 2026-03-17 11:03:20 +03:00
1 parent 8dcde77420
commit e4d5201c05
64 files changed
-3681

No files matched your search

-62
View File
@@ -1,62 +0,0 @@
name: 'PR to master branch from develop'
on:
# Triggered manually
workflow_dispatch:
inputs:
tag:
description: "Tag"
required: true
targetEnv:
description: "Target Environment"
required: true
type: choice
options:
- DEV
- PROD
# Triggered by release-nocodb.yml
workflow_call:
inputs:
tag:
description: "Tag"
required: true
type: string
targetEnv:
description: "Target Environment"
required: true
type: string
jobs:
pr-to-master:
runs-on: ubuntu-22.04
steps:
- run: |
echo 'triggering pr-to-master'
- name: Checkout
uses: actions/checkout@v3
with:
ref: develop
- name: Create Pull Request
if: ${{ github.event.inputs.targetEnv == 'PROD' || inputs.targetEnv == 'PROD' }}
id: cpr
uses: repo-sync/pull-request@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
source_branch: "develop"
destination_branch: "master"
pr_title: '${{ github.event.inputs.tag || inputs.tag }} Pre-release'
pr_label: 'Bot: Automerge'
- name: Check outputs
if: ${{ github.event.inputs.targetEnv == 'PROD' || inputs.targetEnv == 'PROD' }}
run: |
echo "Pull Request Number - ${{ steps.cpr.outputs.pr_number }}"
echo "Pull Request URL - ${{ steps.cpr.outputs.pr_url }}"
- name: automerge
if: ${{ github.event.inputs.targetEnv == 'PROD' || inputs.targetEnv == 'PROD' }}
uses: "pascalgn/automerge-action@v0.15.5"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
PULL_REQUEST: "${{ steps.cpr.outputs.pr_number }}"
MERGE_LABELS: "Bot: Automerge"
-67
View File
@@ -1,67 +0,0 @@
name: "Publish : Api Docs"
on:
workflow_dispatch:
push:
branches: [ master ]
paths:
- "packages/nocodb/src/schema/swagger.json"
release:
types: [ published ]
jobs:
copy-file:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Pushes swagger file to data-apis-v1
uses: dmnemec/copy_file_to_another_repo_action@1b29cbd9a323185f20b175dc6d5f8f31be5c0658
env:
API_TOKEN_GITHUB: ${{ secrets.GH_TOKEN }}
with:
source_file: 'packages/nocodb/src/schema/swagger.json'
destination_repo: 'nocodb/noco-apis-doc'
destination_folder: 'data-apis-v1'
user_email: 'oof1lab@gmail.com'
user_name: 'o1lab'
commit_message: 'Autorelease from github.com/nocodb/nocodb'
- name: Pushes swagger file to meta-apis-v1
uses: dmnemec/copy_file_to_another_repo_action@1b29cbd9a323185f20b175dc6d5f8f31be5c0658
env:
API_TOKEN_GITHUB: ${{ secrets.GH_TOKEN }}
with:
source_file: 'packages/nocodb/src/schema/swagger.json'
destination_repo: 'nocodb/noco-apis-doc'
destination_folder: 'meta-apis-v1'
user_email: 'oof1lab@gmail.com'
user_name: 'o1lab'
commit_message: 'Autorelease from github.com/nocodb/nocodb'
- name: Pushes swagger file to apis-v3
uses: dmnemec/copy_file_to_another_repo_action@1b29cbd9a323185f20b175dc6d5f8f31be5c0658
env:
API_TOKEN_GITHUB: ${{ secrets.GH_TOKEN }}
with:
source_file: 'packages/nocodb/src/schema/swagger-v3.json'
destination_repo: 'nocodb/xc-app-2'
destination_folder: 'website/src/public/apis/v3'
user_email: 'oof1lab@gmail.com'
user_name: 'o1lab'
commit_message: 'Autorelease from github.com/nocodb/nocodb'
- name: Pushes swagger file to apis-v2
uses: dmnemec/copy_file_to_another_repo_action@1b29cbd9a323185f20b175dc6d5f8f31be5c0658
env:
API_TOKEN_GITHUB: ${{ secrets.GH_TOKEN }}
with:
source_file: 'packages/nocodb/src/schema/swagger-v2.json'
destination_repo: 'nocodb/xc-app-2'
destination_folder: 'website/src/public/apis/v2'
user_email: 'oof1lab@gmail.com'
user_name: 'o1lab'
commit_message: 'Autorelease from github.com/nocodb/nocodb'
-34
View File
@@ -1,34 +0,0 @@
name: 'Close Issues with Labels'
on:
# Triggered manually
workflow_dispatch:
inputs:
issue_label:
description: "All issues with such label will be closed"
required: true
version:
description: "Which version is this issue fixed in"
required: true
# Triggered by release-nocodb.yml
workflow_call:
inputs:
issue_label:
description: "All issues with such label will be closed"
required: true
type: string
version:
description: "Which version is this issue fixed in"
required: true
type: string
jobs:
close-issues:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@master
- name: close-resolved-issues
uses: wingkwong/close-issues-based-on-label@master
env:
LABEL: ${{ github.event.inputs.issue_label || inputs.issue_label }}
VERSION: ${{ github.event.inputs.version || inputs.version }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-175
View File
@@ -1,175 +0,0 @@
name: "Release : Docker"
on:
# Triggered manually
workflow_dispatch:
inputs:
tag:
description: "Docker image tag"
required: true
targetEnv:
description: "Target Environment"
required: true
type: choice
options:
- DEV
- PROD
# Triggered by release-nocodb.yml / release-nightly-dev.yml / release-pr.yml
workflow_call:
inputs:
tag:
description: "Docker image tag"
required: true
type: string
targetEnv:
description: "Target Environment"
required: true
type: string
isDaily:
description: "Is it triggered by daily schedule"
required: false
type: string
currentVersion:
description: "The current NocoDB version"
required: false
type: string
secrets:
DOCKERHUB_USERNAME:
required: true
DOCKERHUB_TOKEN:
required: true
jobs:
buildx:
runs-on: ubuntu-22.04
env:
working-directory: ./packages/nocodb
steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
# Prevent removing tools we might implicitly need or that are fast to keep
tool-cache: false
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- name: Get Docker Repository
id: get-docker-repository
run: |
DOCKER_REPOSITORY=nocodb
DOCKER_BUILD_TAG=${{ github.event.inputs.tag || inputs.tag }}
DOCKER_BUILD_LATEST_TAG=latest
if [[ "$DOCKER_BUILD_TAG" =~ "-beta." ]]; then
DOCKER_BUILD_LATEST_TAG=$(echo $DOCKER_BUILD_TAG | awk -F '-beta.' '{print $1}')-beta.latest
fi
if [[ ${{ github.event.inputs.targetEnv || inputs.targetEnv }} == 'DEV' ]]; then
if [[ ${{ github.event.inputs.currentVersion || inputs.currentVersion || 'N/A' }} != 'N/A' ]]; then
DOCKER_BUILD_TAG=${{ github.event.inputs.currentVersion || inputs.currentVersion }}-${{ github.event.inputs.tag || inputs.tag }}
fi
if [[ ${{ inputs.isDaily || 'N' }} == 'Y' ]]; then
DOCKER_REPOSITORY=${DOCKER_REPOSITORY}-daily
else
DOCKER_REPOSITORY=${DOCKER_REPOSITORY}-timely
fi
fi
echo "DOCKER_REPOSITORY=${DOCKER_REPOSITORY}" >> $GITHUB_OUTPUT
echo "DOCKER_BUILD_TAG=${DOCKER_BUILD_TAG}" >> $GITHUB_OUTPUT
echo "DOCKER_BUILD_LATEST_TAG=${DOCKER_BUILD_LATEST_TAG}" >> $GITHUB_OUTPUT
echo DOCKER_REPOSITORY: ${DOCKER_REPOSITORY}
echo DOCKER_BUILD_TAG: ${DOCKER_BUILD_TAG}
echo DOCKER_BUILD_LATEST_TAG: ${DOCKER_BUILD_LATEST_TAG}
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 1
ref: ${{ github.ref }}
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: 22.12.0
- name: upgrade packages for nightly build or pr build
if: ${{ github.event.inputs.targetEnv == 'DEV' || inputs.targetEnv == 'DEV' }}
run: |
export NODE_OPTIONS="--max_old_space_size=8192"
NOCODB_SDK_PKG_NAME=nocodb-sdk-daily
targetEnv=${{ github.event.inputs.targetEnv || inputs.targetEnv }} targetVersion=${{ github.event.inputs.tag || inputs.tag }} node scripts/bumpNocodbSdkVersion.js &&
pnpm --filter=${NOCODB_SDK_PKG_NAME} install --ignore-scripts --no-frozen-lockfile --ignore-workspace && pnpm --filter=${NOCODB_SDK_PKG_NAME} run build &&
targetEnv=${{ github.event.inputs.targetEnv || inputs.targetEnv }} node scripts/upgradeNocodbSdk.js &&
targetEnv=${{ github.event.inputs.targetEnv || inputs.targetEnv }} targetVersion=${{ github.event.inputs.tag || inputs.tag }} node scripts/bumpNcGuiVersion.js &&
pnpm --filter=nc-gui install --ignore-scripts --no-frozen-lockfile &&
targetEnv=${{ github.event.inputs.targetEnv || inputs.targetEnv }} targetVersion=${{ github.event.inputs.tag || inputs.tag }} pnpm --filter=nc-gui run build:copy &&
targetEnv=${{ github.event.inputs.targetEnv || inputs.targetEnv }} node scripts/upgradeNcGui.js
- name: Build nocodb integrations
working-directory: ${{ env.working-directory }}
run: |
cd ../noco-integrations/core
# extract nocodb-sdk or nocodbsdk-daily package name based on env
NOCODB_SDK_PKG_NAME=nocodb-sdk
if [[ ${{ github.event.inputs.targetEnv || inputs.targetEnv }} == 'DEV' ]]; then
NOCODB_SDK_PKG_NAME=nocodb-sdk-daily
fi
pnpm install ${NOCODB_SDK_PKG_NAME}@${{ github.event.inputs.tag || inputs.tag }}
cd ../../..
pnpm run integrations:build && pnpm run registerIntegrations
- name: Build nocodb and docker files
run: |
pnpm install --ignore-scripts --no-frozen-lockfile
pnpm run docker:build
working-directory: ${{ env.working-directory }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2.1.0
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2.2.1
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to DockerHub
uses: docker/login-action@v2.1.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v3.2.0
with:
context: ${{ env.working-directory }}
build-args: NC_VERSION=${{ steps.get-docker-repository.outputs.DOCKER_BUILD_TAG }}
platforms: linux/amd64,linux/arm64,linux/arm/v7
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
push: true
labels: |
"service=nocodb"
tags: |
nocodb/${{ steps.get-docker-repository.outputs.DOCKER_REPOSITORY }}:${{ steps.get-docker-repository.outputs.DOCKER_BUILD_TAG }}
nocodb/${{ steps.get-docker-repository.outputs.DOCKER_REPOSITORY }}:${{ steps.get-docker-repository.outputs.DOCKER_BUILD_LATEST_TAG }}
# Temp fix
# https://github.com/docker/build-push-action/issues/252
# https://github.com/moby/buildkit/issues/1896
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
-74
View File
@@ -1,74 +0,0 @@
name: "Release : Draft Notes"
on:
# Triggered manually
workflow_dispatch:
inputs:
tag:
description: "Tag"
required: true
prev_tag:
description: "Previous Tag"
required: true
tagHeadSHA:
description: "Use HEAD SHA for tagging"
required: true
type: choice
options:
- "Y"
# Triggered by release-nocodb.yml
workflow_call:
inputs:
tag:
description: "Tag"
required: true
type: string
prev_tag:
description: "Previous Tag"
required: true
type: string
tagHeadSHA:
description: "Use HEAD SHA for tagging"
required: true
type: string
secrets:
NC_GITHUB_TOKEN:
required: true
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.ref }}
- name: Get SHA
id: get-sha
# If it's triggered by release-nocodb.yml,
# the SHA from the third commit (i.e. Auto PR from master to develop) will be taken
# else HEAD will be taken
run: |
TARGET_SHA=$(git rev-list -n 3 HEAD | tail -1)
if [[ ${{ github.event.inputs.tagHeadSHA || inputs.tagHeadSHA }} == "Y" ]]; then
TARGET_SHA=$(git rev-list -n 1 HEAD | tail -1)
fi
echo "TARGET_SHA=${TARGET_SHA}" >> $GITHUB_OUTPUT
echo "Setting TARGET_SHA: ${TARGET_SHA}"
- name: Create tag
uses: actions/github-script@v3
with:
# need workflows permission but it's not in GITHUB_TOKEN scope
# need a custom PAT with workflows permission here
github-token: ${{ secrets.NC_GITHUB_TOKEN }}
script: |
github.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: "refs/tags/${{ github.event.inputs.tag || inputs.tag }}",
sha: "${{ steps.get-sha.outputs.TARGET_SHA }}"
})
- uses: actions/setup-node@v3
with:
node-version: 22.12.0
- run: "npx github-release-notes@0.17.2 release --token ${{ secrets.GITHUB_TOKEN }} --draft --tags ${{ github.event.inputs.tag || inputs.tag }}..${{ github.event.inputs.prev_tag || inputs.prev_tag }}"
-247
View File
@@ -1,247 +0,0 @@
name: "Release : Executables"
on:
# Triggered manually
workflow_dispatch:
inputs:
tag:
description: "Tag name"
required: true
# Triggered by release-nocodb.yml
workflow_call:
inputs:
tag:
description: "Tag name"
required: true
type: string
secrets:
NC_GITHUB_TOKEN:
required: true
jobs:
build-executables:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Get pnpm store directory
shell: bash
run: |
sed -i '/^use-node-version/d' .npmrc
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Cache pkg modules
id: cache-pkg
uses: actions/cache@v3
env:
cache-name: cache-pkg
with:
# pkg cache files are stored in `~/.pkg-cache`
path: ~/.pkg-cache
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
# for building images for all platforms these libraries are required in Linux
- name: Install QEMU and ldid
run: |
sudo apt update
# Install qemu
sudo apt install qemu binfmt-support qemu-user-static
# install ldid
git clone https://github.com/daeken/ldid.git
cd ./ldid
./make.sh
sudo cp ./ldid /usr/local/bin
- uses: actions/setup-node@v3
with:
# pkg library doesn't have node 22 support
node-version: 22.12.0
- name : Install nocodb, other dependencies and build executables
run: |
cd ./scripts/pkg-executable
# downgrade sqlite3 to 5.1.6 until build related issues are resolved
# https://github.com/TryGhost/node-sqlite3/issues/1748
node ../downgradeSqlite.js
# Install nocodb version based on provided tag name
npm i -E nocodb@${{ github.event.inputs.tag || inputs.tag }}
# install npm dependendencies
npm i
# Build sqlite binaries for all platforms
./node_modules/.bin/node-pre-gyp install --directory=./node_modules/sqlite3 --target_platform=win32 --fallback-to-build --target_arch=x64 --target_libc=unknown
./node_modules/.bin/node-pre-gyp install --directory=./node_modules/sqlite3 --target_platform=win32 --fallback-to-build --target_arch=ia32 --target_libc=unknown
./node_modules/.bin/node-pre-gyp install --directory=./node_modules/sqlite3 --target_platform=darwin --fallback-to-build --target_arch=x64 --target_libc=unknown
./node_modules/.bin/node-pre-gyp install --directory=./node_modules/sqlite3 --target_platform=darwin --fallback-to-build --target_arch=arm64 --target_libc=unknown
./node_modules/.bin/node-pre-gyp install --directory=./node_modules/sqlite3 --target_platform=linux --fallback-to-build --target_arch=x64 --target_libc=glibc
./node_modules/.bin/node-pre-gyp install --directory=./node_modules/sqlite3 --target_platform=linux --fallback-to-build --target_arch=arm64 --target_libc=glibc
./node_modules/.bin/node-pre-gyp install --directory=./node_modules/sqlite3 --target_platform=linux --fallback-to-build --target_arch=x64 --target_libc=musl
./node_modules/.bin/node-pre-gyp install --directory=./node_modules/sqlite3 --target_platform=linux --fallback-to-build --target_arch=arm64 --target_libc=musl
# clean up code to optimize size
npx modclean --patterns="default:*" --ignore="nc-lib-gui/**,nocodb/**,dayjs/**,express-status-monitor/**,sqlite3/**,jsdom/**" --run
mkdir ./mac-dist
mkdir ./dist
npm install -g @yao-pkg/pkg
# build darwin x64 executable
npm uninstall sharp
npm install --cpu=x64 --os=darwin sharp
pkg . --compress GZip -t node22-macos-x64 -o Noco-macos-x64
mv ./Noco-macos-x64 ./mac-dist/
# build darwin arm64 executable
npm uninstall sharp
npm install --cpu=arm64 --os=darwin sharp
pkg . --compress GZip -t node22-macos-arm64 -o Noco-macos-arm64
mv ./Noco-macos-arm64 ./mac-dist/
# build linux x64 executable
npm uninstall sharp
npm install --cpu=x64 --os=linux sharp
pkg . --compress GZip -t node22-linux-x64 -o Noco-linux-x64
mv ./Noco-linux-x64 ./dist/
# build linux arm64 executable
npm uninstall sharp
npm install --cpu=arm64 --os=linux sharp
pkg . --compress GZip -t node22-linux-arm64 -o Noco-linux-arm64
mv ./Noco-linux-arm64 ./dist/
# build windows x64 executable
npm uninstall sharp
npm install --cpu=x64 --os=win32 sharp
pkg . --compress GZip -t node22-win-x64 -o Noco-win-x64.exe
mv ./Noco-win-x64.exe ./dist/
# build windows arm64 executable
npm uninstall sharp
npm install --cpu=arm64 --os=win32 sharp
pkg . --compress GZip -t node22-win-arm64 -o Noco-win-arm64.exe
mv ./Noco-win-arm64.exe ./dist/
- name: Upload executables to asset
id: upload-release-asset
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
draft: true
tag_name: ${{ github.event.inputs.tag || inputs.tag }}
files: |
./scripts/pkg-executable/dist/Noco-win-arm64.exe
./scripts/pkg-executable/dist/Noco-win-x64.exe
./scripts/pkg-executable/dist/Noco-linux-arm64
./scripts/pkg-executable/dist/Noco-linux-x64
- uses: actions/upload-artifact@master
with:
name: ${{ github.event.inputs.tag || inputs.tag }}
path: scripts/pkg-executable/mac-dist
retention-days: 1
sign-mac-executables:
runs-on: macos-latest
needs: build-executables
steps:
- uses: actions/download-artifact@master
with:
name: ${{ github.event.inputs.tag || inputs.tag }}
path: scripts/pkg-executable/mac-dist
- name: Sign macOS executables
run: |
/usr/bin/codesign --force -s - ./scripts/pkg-executable/mac-dist/Noco-macos-arm64 -v
/usr/bin/codesign --force -s - ./scripts/pkg-executable/mac-dist/Noco-macos-x64 -v
- uses: actions/upload-artifact@master
with:
name: ${{ format('{0}-signed', github.event.inputs.tag || inputs.tag) }}
path: scripts/pkg-executable/mac-dist
retention-days: 1
publish-mac-executables-and-homebrew:
needs: [sign-mac-executables,build-executables]
runs-on: ubuntu-22.04
steps:
- uses: actions/download-artifact@master
with:
name: ${{ format('{0}-signed', github.event.inputs.tag || inputs.tag) }}
path: scripts/pkg-executable/mac-dist
- uses: actions/checkout@v3
with:
path: 'homebrew-nocodb'
token: ${{ secrets.NC_GITHUB_TOKEN }}
repository: 'nocodb/homebrew-nocodb'
fetch-depth: 0
- name: Compress files and calculate checksum
run: |
cd ./scripts/pkg-executable
cp ./mac-dist/Noco-macos-x64 ./mac-dist/nocodb
tar -czf ./mac-dist/nocodb.tar.gz ./mac-dist/nocodb
rm ./mac-dist/nocodb
echo "CHECKSUM=$(shasum -a 256 ./mac-dist/nocodb.tar.gz | awk '{print $1}')" >> $GITHUB_OUTPUT
id: compress
- name: Upload macos executable to asset
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
draft: true
tag_name: ${{ github.event.inputs.tag || inputs.tag }}
files: |
./scripts/pkg-executable/mac-dist/Noco-macos-x64
./scripts/pkg-executable/mac-dist/Noco-macos-arm64
./scripts/pkg-executable/mac-dist/nocodb.tar.gz
- name: Generate Homebrew Formula class and push
run: |
FORMULA_CLASS_STR=$(cat << EOF
class Nocodb < Formula
desc "NocoDB : Opensource smart spreadsheet"
homepage "https://github.com/nocodb/nocodb"
url "https://github.com/nocodb/nocodb/releases/download/${{ github.event.inputs.tag || inputs.tag }}/nocodb.tar.gz"
sha256 "${{ steps.compress.outputs.CHECKSUM }}"
license "MIT"
version "${{ github.event.inputs.tag || inputs.tag }}"
def install
bin.install "nocodb"
end
end
EOF
)
cd ./homebrew-nocodb
printf "$FORMULA_CLASS_STR" > ./Formula/nocodb.rb
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
git commit ./Formula/nocodb.rb -m "Automatic publish"
git push
-67
View File
@@ -1,67 +0,0 @@
name: 'NocoDB Nightly Dev Release'
on:
# Triggered manually
workflow_dispatch:
schedule:
# every 6 hours
- cron: '0 */6 * * *'
jobs:
# enrich tag for nightly auto release
set-tag:
runs-on: 'ubuntu-22.04'
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 1
ref: ${{ github.ref }}
- name: set-tag
id: tag-step
run: |
# Get current date
CURRENT_DATE=$(date +"%Y%m%d")
CURRENT_TIME=$(date +"%H%M")
TAG_NAME=${CURRENT_DATE}-${CURRENT_TIME}
IS_DAILY='Y'
# Get current version
CURRENT_VERSION=$(cat ./packages/nocodb/package.json | jq -r ".version")
# Set the tag
if [[ ${{ github.event_name }} == 'workflow_dispatch' ]]; then
IS_DAILY='N'
fi
echo "NIGHTLY_BUILD_TAG=${TAG_NAME}" >> $GITHUB_OUTPUT
echo "IS_DAILY=${IS_DAILY}" >> $GITHUB_OUTPUT
echo "CURRENT_VERSION=${CURRENT_VERSION}" >> $GITHUB_OUTPUT
- name: verify-tag
run: |
echo ${{ steps.tag-step.outputs.NIGHTLY_BUILD_TAG }}
echo ${{ steps.tag-step.outputs.IS_DAILY }}
echo ${{ steps.tag-step.outputs.CURRENT_VERSION }}
outputs:
nightly_build_tag: ${{ steps.tag-step.outputs.NIGHTLY_BUILD_TAG }}
is_daily: ${{ steps.tag-step.outputs.IS_DAILY }}
current_version: ${{ steps.tag-step.outputs.CURRENT_VERSION }}
# Build executables and publish to GitHub
# release-executables:
# needs: [set-tag, release-npm]
# uses: ./.github/workflows/release-timely-executables.yml
# with:
# tag: ${{ needs.set-tag.outputs.current_version }}-${{ needs.set-tag.outputs.nightly_build_tag }}
# secrets:
# NC_GITHUB_TOKEN: "${{ secrets.NC_GITHUB_TOKEN }}"
# Build docker image and push to docker hub
release-docker:
needs: [set-tag]
uses: ./.github/workflows/release-timely-docker.yml
with:
currentVersion: ${{ needs.set-tag.outputs.current_version }}
tag: ${{ needs.set-tag.outputs.nightly_build_tag }}
targetEnv: 'DEV'
isDaily: ${{ needs.set-tag.outputs.is_daily }}
secrets:
DOCKERHUB_USERNAME: "${{ secrets.DOCKERHUB_USERNAME }}"
DOCKERHUB_TOKEN: "${{ secrets.DOCKERHUB_TOKEN }}"
-116
View File
@@ -1,116 +0,0 @@
name: 'NocoDB Release'
on:
# Triggered manually
workflow_dispatch:
inputs:
tag:
description: "Target Tag"
required: false
prev_tag:
description: "Previous Tag"
required: false
jobs:
# Validate Branch
validate-branch:
runs-on: ubuntu-22.04
steps:
- run: |
if [[ ${{ github.ref }} != 'refs/heads/master' ]]; then
echo "NocoDB Release is only allowed to run on master branch"
exit 1
fi
# Process Input
process-input:
runs-on: ubuntu-22.04
needs: validate-branch
outputs:
target_tag: ${{ steps.process-input.outputs.target_tag }}
prev_tag: ${{ steps.process-input.outputs.prev_tag }}
steps:
- id: process-input
name: process-input
run: |
TARGET_TAG=${{github.event.inputs.tag}}
PREV_TAG=${{github.event.inputs.prev_tag}}
if [[ ${PREV_TAG} == '' ]]; then
# fetch the latest version
PREV_TAG=$(basename $(curl -fs -o/dev/null -w %{redirect_url} https://github.com/nocodb/nocodb/releases/latest))
fi
if [[ ${TARGET_TAG} == '' ]]; then
# bump the version from PREV_TAG
TARGET_TAG=$(echo ${PREV_TAG} | awk -F. -v OFS=. '{$NF += 1 ; print}')
fi
echo "TARGET_TAG=${TARGET_TAG}" >> $GITHUB_OUTPUT
echo "PREV_TAG=${PREV_TAG}" >> $GITHUB_OUTPUT
- name: Verify
run : |
echo TARGET_TAG: ${{ steps.process-input.outputs.target_tag }}
echo PREV_TAG: ${{ steps.process-input.outputs.prev_tag }}
# Merge develop to master
pr-to-master:
needs: process-input
uses: ./.github/workflows/pr-to-master.yml
with:
tag: ${{ needs.process-input.outputs.target_tag }}
targetEnv: ${{ github.event.inputs.targetEnv || 'PROD' }}
# Build, install, publish frontend and backend to npm
release-npm:
needs: [pr-to-master, process-input]
uses: ./.github/workflows/release-npm.yml
with:
tag: ${{ needs.process-input.outputs.target_tag }}
targetEnv: ${{ github.event.inputs.targetEnv || 'PROD' }}
secrets:
NPM_TOKEN: "${{ secrets.NPM_TOKEN }}"
# Create a PR to sync changes back to develop branch from master
sync-to-develop:
needs: [release-npm, process-input]
uses: ./.github/workflows/sync-to-develop.yml
# Draft Release Note
release-draft-note:
needs: [release-npm, process-input]
uses: ./.github/workflows/release-draft.yml
with:
tag: ${{ needs.process-input.outputs.target_tag }}
prev_tag: ${{ needs.process-input.outputs.prev_tag }}
tagHeadSHA: 'N'
secrets:
NC_GITHUB_TOKEN: "${{ secrets.NC_GITHUB_TOKEN }}"
# Build docker image and push to docker hub
release-docker:
needs: [release-draft-note, process-input]
uses: ./.github/workflows/release-docker.yml
with:
currentVersion: 'N/A'
tag: ${{ needs.process-input.outputs.target_tag }}
targetEnv: ${{ github.event.inputs.targetEnv || 'PROD' }}
secrets:
DOCKERHUB_USERNAME: "${{ secrets.DOCKERHUB_USERNAME }}"
DOCKERHUB_TOKEN: "${{ secrets.DOCKERHUB_TOKEN }}"
# Build executables and publish to GitHub
release-executables:
needs: [release-draft-note, process-input]
uses: ./.github/workflows/release-executables.yml
with:
tag: ${{ needs.process-input.outputs.target_tag }}
secrets:
NC_GITHUB_TOKEN: "${{ secrets.NC_GITHUB_TOKEN }}"
# Close all issues with target tags 'Status: Ready for Next Release'
# close-issues:
# needs: [release-docker, process-input]
# uses: ./.github/workflows/release-close-issue.yml
# with:
# issue_label: '🚀 Status: Ready for Next Release'
# version: ${{ needs.process-input.outputs.target_tag }}
-103
View File
@@ -1,103 +0,0 @@
name: "Release : NPM packages"
on:
# Triggered manually
workflow_dispatch:
inputs:
tag:
description: "Tag"
required: true
targetEnv:
description: "Target Environment"
required: true
type: choice
options:
- DEV
- PROD
# Triggered by release-nocodb.yml / release-nightly-dev.yml / release-pr.yml
workflow_call:
inputs:
tag:
description: "Tag"
required: true
type: string
targetEnv:
description: "Target Environment"
required: true
type: string
secrets:
NPM_TOKEN:
required: true
# GITHUB_TOKEN:
# required: true
jobs:
release:
runs-on: ubuntu-22.04
env:
working-directory: ./packages/nocodb
steps:
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.ref }}
- name: pnpm Setup and Publish with 18.19.1
# Setup .npmrc file to publish to npm
uses: actions/setup-node@v3
with:
node-version: 22.12.0
registry-url: "https://registry.npmjs.org"
- run: |
export NODE_OPTIONS="--max_old_space_size=8192"
NOCODB_SDK_PKG_NAME=nocodb-sdk
# If targetEnv is DEV, then use nocodb-sdk-daily package
if [[ ${{ github.event.inputs.targetEnv || inputs.targetEnv }} == 'DEV' ]]; then
NOCODB_SDK_PKG_NAME=nocodb-sdk-daily
fi
echo $NOCODB_SDK_PKG_NAME
targetEnv=${{ github.event.inputs.targetEnv || inputs.targetEnv }} targetVersion=${{ github.event.inputs.tag || inputs.tag }} node scripts/bumpNocodbSdkVersion.js &&
pnpm --filter=${NOCODB_SDK_PKG_NAME} install --ignore-scripts --no-frozen-lockfile --ignore-workspace && pnpm --filter=${NOCODB_SDK_PKG_NAME} run build && pnpm --filter=${NOCODB_SDK_PKG_NAME} publish --no-git-checks &&
echo "$(date)" &&
sleep 300 &&
echo "$(date)" &&
targetEnv=${{ github.event.inputs.targetEnv || inputs.targetEnv }} node scripts/upgradeNocodbSdk.js &&
targetEnv=${{ github.event.inputs.targetEnv || inputs.targetEnv }} targetVersion=${{ github.event.inputs.tag || inputs.tag }} node scripts/bumpNcGuiVersion.js &&
pnpm --filter=nc-gui install --ignore-scripts --no-frozen-lockfile &&
targetEnv=${{ github.event.inputs.targetEnv || inputs.targetEnv }} targetVersion=${{ github.event.inputs.tag || inputs.tag }} pnpm --filter=nc-gui run build:copy:publish --no-git-checks &&
echo "$(date)" &&
sleep 300 &&
echo "$(date)" &&
# Build nocodb integrations
pnpm run integrations:build && pnpm run registerIntegrations &&
targetEnv=${{ github.event.inputs.targetEnv || inputs.targetEnv }} node scripts/upgradeNcGui.js && cd packages/nocodb && pnpm run obfuscate:build:publish --no-git-checks
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Create Pull Request
if: ${{ github.event.inputs.targetEnv == 'PROD' || inputs.targetEnv == 'PROD' }}
id: cpr
uses: peter-evans/create-pull-request@v4.2.3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
signoff: true
branch: "release/${{ github.event.inputs.tag || inputs.tag }}"
delete-branch: true
title: "Release ${{ github.event.inputs.tag || inputs.tag }}"
labels: "Bot: Automerge"
- name: Check outputs
if: ${{ github.event.inputs.targetEnv == 'PROD' || inputs.targetEnv == 'PROD' }}
run: |
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
- name: automerge
if: ${{ github.event.inputs.targetEnv == 'PROD' || inputs.targetEnv == 'PROD' }}
uses: "pascalgn/automerge-action@v0.15.5"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
PULL_REQUEST: "${{ steps.cpr.outputs.pull-request-number }}"
MERGE_LABELS: "Bot: Automerge"
-182
View File
@@ -1,182 +0,0 @@
name: 'PR Release'
on:
pull_request:
# opened: pull request is created
# reopened: closed pull request is reopened
# synchronize: commit(s) pushed to the pull request
# ready_for_review: non PR release
# closed: pull request is closed, used to delete uffizzi previews
types: [opened, reopened, synchronize, ready_for_review, closed]
paths:
- "packages/nocodb-sdk/**"
- "packages/nc-gui/**"
- "packages/nocodb/**"
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
# enrich tag for pr release
set-tag:
if: ${{ github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]' && github.event.pull_request.draft == false && github.base_ref == 'develop' && github.event.action != 'closed' }}
runs-on: 'ubuntu-22.04'
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 1
ref: ${{ github.ref }}
- name: set-tag
id: tag-step
run: |
# Get current date
CURRENT_DATE=$(date +"%Y%m%d")
CURRENT_TIME=$(date +"%H%M")
# Get current PR number
PR_NUMBER=${{github.event.number}}
# Get current version
CURRENT_VERSION=$(cat ./packages/nocodb/package.json | jq -r ".version")
# Construct tag name
TAG_NAME=pr-${PR_NUMBER}-${CURRENT_DATE}-${CURRENT_TIME}
echo "TARGET_TAG=${TAG_NAME}" >> $GITHUB_OUTPUT
echo "CURRENT_VERSION=${CURRENT_VERSION}" >> $GITHUB_OUTPUT
- name: verify-tag
run: |
echo ${{ steps.tag-step.outputs.TARGET_TAG }}
echo ${{ steps.tag-step.outputs.CURRENT_VERSION }}
outputs:
target_tag: ${{ steps.tag-step.outputs.TARGET_TAG }}
current_version: ${{ steps.tag-step.outputs.CURRENT_VERSION }}
# Build docker image and push to docker hub
release-docker:
if: ${{ github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]' && github.event.pull_request.draft == false && github.base_ref == 'develop' && github.event.action != 'closed' }}
needs: [set-tag]
uses: ./.github/workflows/release-timely-docker.yml
with:
currentVersion: ${{ needs.set-tag.outputs.current_version }}
tag: ${{ needs.set-tag.outputs.target_tag }}
targetEnv: 'DEV'
isDaily: 'N'
secrets:
DOCKERHUB_USERNAME: "${{ secrets.DOCKERHUB_USERNAME }}"
DOCKERHUB_TOKEN: "${{ secrets.DOCKERHUB_TOKEN }}"
# Build executables and publish to GitHub
# release-executables:
# if: ${{ github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]' && github.event.pull_request.draft == false && github.base_ref == 'develop' && github.event.action != 'closed' }}
# needs: [set-tag, release-npm]
# uses: ./.github/workflows/release-timely-executables.yml
# with:
# tag: ${{ needs.set-tag.outputs.current_version }}-${{ needs.set-tag.outputs.target_tag }}
# secrets:
# NC_GITHUB_TOKEN: "${{ secrets.NC_GITHUB_TOKEN }}"
# Add a comment for PR docker build
leave-comment:
if: ${{ github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]' && github.event.pull_request.draft == false && github.base_ref == 'develop' && github.event.action != 'closed' }}
runs-on: 'ubuntu-22.04'
needs: [release-docker, set-tag]
steps:
- uses: peter-evans/commit-comment@v2
with:
body: |
The PR changes have been deployed. Please run the following command to verify:
```
docker run -d -p 8888:8080 nocodb/nocodb-timely:${{ needs.set-tag.outputs.current_version }}-${{ needs.set-tag.outputs.target_tag }}
```
# Create a preview for the pull request
preview-pull-request:
name: "Trigger Uffizzi Preview"
if: ${{ github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]' && github.event.pull_request.draft == false && github.base_ref == 'develop' && github.event.action != 'closed' }}
runs-on: 'ubuntu-22.04'
needs: [release-docker, set-tag]
outputs:
compose-file-cache-key: ${{ env.COMPOSE_FILE_HASH }}
steps:
- name: Checkout git repo
uses: actions/checkout@v3
- name: Render Compose File
run: |
NOCODB_IMAGE=nocodb/nocodb-timely:${{ needs.set-tag.outputs.current_version }}-${{ needs.set-tag.outputs.target_tag }}
export NOCODB_IMAGE
# Render simple template from environment variables.
envsubst < .github/uffizzi/docker-compose.uffizzi.yml > docker-compose.rendered.yml
cat docker-compose.rendered.yml
- name: Upload Rendered Compose File as Artifact
uses: actions/upload-artifact@v4
with:
name: preview-spec-docker-compose
path: docker-compose.rendered.yml
retention-days: 2
- name: Serialize PR Event to File
run: |
cat << EOF > event.json
${{ toJSON(github.event) }}
EOF
- name: Upload PR Event as Artifact
uses: actions/upload-artifact@v4
with:
name: preview-spec-event
path: event.json
retention-days: 2
# Add a comment for PR executable build
# leave-executable-comment:
# if: ${{ github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]' && github.event.pull_request.draft == false && github.base_ref == 'develop' && github.event.action != 'closed' }}
# runs-on: 'ubuntu-22.04'
# needs: [release-executables, set-tag]
# steps:
# - uses: peter-evans/commit-comment@v2
# with:
# body: |
# ### Run Executables
# #### MacOS
# ```bash
# mkdir -p ./${{ needs.set-tag.outputs.current_version }}/${{ needs.set-tag.outputs.target_tag }} && cd "$_" \
# && curl http://dl.nocodb.com/${{ needs.set-tag.outputs.current_version }}-${{ needs.set-tag.outputs.target_tag }}/Noco-macos-arm64 -o noco -L \
# && chmod +x noco \
# && ./noco
# ```
# #### Linux
# ```bash
# mkdir -p ./${{ needs.set-tag.outputs.current_version }}/${{ needs.set-tag.outputs.target_tag }} && cd "$_" \
# && curl http://dl.nocodb.com/${{ needs.set-tag.outputs.current_version }}-${{ needs.set-tag.outputs.target_tag }}/Noco-linux-x64 -o noco -L \
# && chmod +x noco \
# && ./noco
# ```
# #### Windows
# ```bash
# iwr http://dl.nocodb.com/${{ needs.set-tag.outputs.current_version }}-${{ needs.set-tag.outputs.target_tag }}/Noco-win-arm64.exe
# .\Noco-win-arm64.exe
# ```
# For executables visit [here](https://github.com/nocodb/nocodb-timely/releases/tag/${{ needs.set-tag.outputs.current_version }}-${{ needs.set-tag.outputs.target_tag }})
# delete the uffizzi preview created off of this PR
delete-uffizzi-preview:
name: Call for Preview Deletion
runs-on: ubuntu-22.04
if: ${{ github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]' && github.event.pull_request.draft == false && github.base_ref == 'develop' && github.event.action == 'closed' }}
steps:
# If this PR is closing, we will not render a compose file nor pass it to the next workflow.
- name: Serialize PR Event to File
run: |
cat << EOF > event.json
${{ toJSON(github.event) }}
EOF
- name: Upload PR Event as Artifact
uses: actions/upload-artifact@v4
with:
name: preview-spec-event
path: event.json
retention-days: 2
overwrite: true
@@ -1,26 +0,0 @@
name: "Release: Previous Docker"
on:
workflow_dispatch:
inputs:
tag:
description: "Previous Docker image tag"
required: true
jobs:
login:
runs-on: ubuntu-22.04
steps:
-
name: Login to Docker Hub
uses: docker/login-action@v2.1.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Docker retag and push
run: |
docker pull nocodb/nocodb:${{ github.event.inputs.tag }}
docker image tag nocodb/nocodb:${{ github.event.inputs.tag }} nocodb/nocodb:latest
docker push nocodb/nocodb:latest
-153
View File
@@ -1,153 +0,0 @@
name: "Release : Secret CLI NPM & Executables"
on:
# Triggered manually
workflow_dispatch:
inputs:
tag:
description: "Tag name"
required: true
secrets:
# Replace with `NC_GITHUB_TOKEN` once replaced with a token which have access to `nocodb/nc-secret-mgr`
NC_GITHUB_TOKEN_TEMP:
required: true
jobs:
build-and-publish:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- name: Setup Node 22.12.0
# Setup .npmrc file to publish to npm
uses: actions/setup-node@v3
with:
node-version: 22.12.0
registry-url: "https://registry.npmjs.org"
- name: Cache pkg modules
id: cache-pkg
uses: actions/cache@v3
env:
cache-name: cache-pkg
with:
# pkg cache files are stored in `~/.pkg-cache`
path: ~/.pkg-cache
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Npm package build and publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
pnpm bootstrap
cd ./packages/nocodb
pnpm run build:cli:module
cd ../nc-secret-mgr
targetVersion=${{ github.event.inputs.tag || inputs.tag }} node ../../scripts/updateCliVersion.js
pnpm run build && pnpm run npm:publish
# for building images for all platforms these libraries are required in Linux
- name: Install QEMU and ldid
run: |
sudo apt update
# Install qemu
sudo apt install qemu binfmt-support qemu-user-static -y
# install ldid
git clone https://github.com/daeken/ldid.git
cd ./ldid
./make.sh
sudo cp ./ldid /usr/local/bin
- uses: actions/setup-node@v3
with:
node-version: 22.12.0
- name: Install nocodb, other dependencies and build executables
run: |
cd ./packages/nc-secret-mgr
# install npm dependendencies
pnpm i
# Build sqlite binaries for all platforms
./node_modules/.bin/node-pre-gyp install --directory=./node_modules/sqlite3 --target_platform=win32 --fallback-to-build --target_arch=x64 --target_libc=unknown
./node_modules/.bin/node-pre-gyp install --directory=./node_modules/sqlite3 --target_platform=win32 --fallback-to-build --target_arch=ia32 --target_libc=unknown
./node_modules/.bin/node-pre-gyp install --directory=./node_modules/sqlite3 --target_platform=darwin --fallback-to-build --target_arch=x64 --target_libc=unknown
./node_modules/.bin/node-pre-gyp install --directory=./node_modules/sqlite3 --target_platform=darwin --fallback-to-build --target_arch=arm64 --target_libc=unknown
./node_modules/.bin/node-pre-gyp install --directory=./node_modules/sqlite3 --target_platform=linux --fallback-to-build --target_arch=x64 --target_libc=glibc
./node_modules/.bin/node-pre-gyp install --directory=./node_modules/sqlite3 --target_platform=linux --fallback-to-build --target_arch=arm64 --target_libc=glibc
./node_modules/.bin/node-pre-gyp install --directory=./node_modules/sqlite3 --target_platform=linux --fallback-to-build --target_arch=x64 --target_libc=musl
./node_modules/.bin/node-pre-gyp install --directory=./node_modules/sqlite3 --target_platform=linux --fallback-to-build --target_arch=arm64 --target_libc=musl
# clean up code to optimize size
npx modclean --patterns="default:*" --run
# build executables
npm run build:pkg
ls ./dist-pkg
# Move macOS executables for signing
mkdir ./mac-dist
mv ./dist-pkg/nc-secret-mgr-macos-arm64 ./mac-dist/
mv ./dist-pkg/nc-secret-mgr-macos-x64 ./mac-dist/
- name: Upload executables(except mac executables) to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.NC_GITHUB_TOKEN_TEMP }}
file: packages/nc-secret-mgr/dist-pkg/**
tag: ${{ github.event.inputs.tag || inputs.tag }}
overwrite: true
file_glob: true
repo_name: nocodb/nc-secret-mgr
- uses: actions/upload-artifact@master
with:
name: ${{ github.event.inputs.tag || inputs.tag }}
path: packages/nc-secret-mgr/mac-dist
retention-days: 1
sign-mac-executables:
runs-on: macos-latest
needs: build-and-publish
steps:
- uses: actions/download-artifact@master
with:
name: ${{ github.event.inputs.tag || inputs.tag }}
path: packages/nc-secret-mgr/mac-dist
- name: Sign macOS executables
run: |
/usr/bin/codesign --force -s - ./packages/nc-secret-mgr/mac-dist/nc-secret-mgr-macos-arm64 -v
/usr/bin/codesign --force -s - ./packages/nc-secret-mgr/mac-dist/nc-secret-mgr-macos-x64 -v
- uses: actions/upload-artifact@master
with:
name: ${{ format('{0}-signed', github.event.inputs.tag || inputs.tag) }}
path: packages/nc-secret-mgr/mac-dist
retention-days: 1
publish-mac-executables:
needs: [sign-mac-executables, build-and-publish]
runs-on: ubuntu-22.04
steps:
- uses: actions/download-artifact@master
with:
name: ${{ format('{0}-signed', github.event.inputs.tag || inputs.tag) }}
path: packages/nc-secret-mgr/mac-dist
- name: Upload executables(except mac executables) to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.NC_GITHUB_TOKEN_TEMP }}
file: packages/nc-secret-mgr/mac-dist/**
tag: ${{ github.event.inputs.tag || inputs.tag }}
overwrite: true
file_glob: true
repo_name: nocodb/nc-secret-mgr
-161
View File
@@ -1,161 +0,0 @@
name: "Release : Timely Docker"
on:
# Triggered manually
workflow_dispatch:
inputs:
tag:
description: "Docker image tag"
required: true
targetEnv:
description: "Target Environment"
required: true
type: choice
options:
- DEV
- PROD
# Triggered by release-nocodb.yml / release-nightly-dev.yml / release-pr.yml
workflow_call:
inputs:
tag:
description: "Docker image tag"
required: true
type: string
targetEnv:
description: "Target Environment"
required: true
type: string
isDaily:
description: "Is it triggered by daily schedule"
required: false
type: string
currentVersion:
description: "The current NocoDB version"
required: false
type: string
secrets:
DOCKERHUB_USERNAME:
required: true
DOCKERHUB_TOKEN:
required: true
jobs:
buildx:
runs-on: ubuntu-22.04
env:
working-directory: ./packages/nocodb
steps:
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- name: Get Docker Repository
id: get-docker-repository
run: |
DOCKER_REPOSITORY=nocodb-daily
DOCKER_BUILD_TAG=${{ github.event.inputs.tag || inputs.tag }}
DOCKER_BUILD_LATEST_TAG=latest
if [[ "$DOCKER_BUILD_TAG" =~ "-beta." ]]; then
DOCKER_BUILD_LATEST_TAG=$(echo $DOCKER_BUILD_TAG | awk -F '-beta.' '{print $1}')-beta.latest
fi
if [[ ${{ github.event.inputs.targetEnv || inputs.targetEnv }} == 'DEV' ]]; then
if [[ ${{ github.event.inputs.currentVersion || inputs.currentVersion || 'N/A' }} != 'N/A' ]]; then
DOCKER_BUILD_TAG=${{ github.event.inputs.currentVersion || inputs.currentVersion }}-${{ github.event.inputs.tag || inputs.tag }}
fi
if [[ ${{ inputs.isDaily || 'N' }} == 'Y' ]]; then
DOCKER_REPOSITORY=nocodb-daily
else
DOCKER_REPOSITORY=nocodb-timely
fi
fi
echo "DOCKER_REPOSITORY=${DOCKER_REPOSITORY}" >> $GITHUB_OUTPUT
echo "DOCKER_BUILD_TAG=${DOCKER_BUILD_TAG}" >> $GITHUB_OUTPUT
echo "DOCKER_BUILD_LATEST_TAG=${DOCKER_BUILD_LATEST_TAG}" >> $GITHUB_OUTPUT
echo DOCKER_REPOSITORY: ${DOCKER_REPOSITORY}
echo DOCKER_BUILD_TAG: ${DOCKER_BUILD_TAG}
echo DOCKER_BUILD_LATEST_TAG: ${DOCKER_BUILD_LATEST_TAG}
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 1
ref: ${{ github.ref }}
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: 22.12.0
- name: install dependencies
run: pnpm bootstrap
- name: Build gui and sdk
run: |
pnpm bootstrap &&
cd packages/nc-gui &&
pnpm run generate
# copy build to nocodb
rsync -rvzh ./dist/ ../nocodb/docker/nc-gui/
- name: build nocodb
run: |
# build nocodb ( pack nocodb-sdk and nc-gui )
cd packages/nocodb &&
EE=true pnpm exec rspack --config rspack.timely.config.js &&
# remove bundled libraries (nocodb-sdk, knex-snowflake)
pnpm uninstall --save-prod nocodb-sdk
- name: Update version in package.json
run: |
# update package.json
cd packages/nocodb &&
jq --arg VERSION "$VERSION" '.version = $VERSION' package.json > tmp.json &&
mv tmp.json package.json
env:
VERSION: ${{ steps.get-docker-repository.outputs.DOCKER_BUILD_TAG }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2.1.0
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2.2.1
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to DockerHub
uses: docker/login-action@v2.1.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v3.2.0
with:
context: ${{ env.working-directory }}
file: ${{ env.working-directory }}/Dockerfile.timely
build-args: NC_VERSION=${{ steps.get-docker-repository.outputs.DOCKER_BUILD_TAG }}
platforms: linux/amd64,linux/arm64
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
push: true
tags: |
nocodb/${{ steps.get-docker-repository.outputs.DOCKER_REPOSITORY }}:${{ steps.get-docker-repository.outputs.DOCKER_BUILD_TAG }}
nocodb/${{ steps.get-docker-repository.outputs.DOCKER_REPOSITORY }}:${{ steps.get-docker-repository.outputs.DOCKER_BUILD_LATEST_TAG }}
# Temp fix
# https://github.com/docker/build-push-action/issues/252
# https://github.com/moby/buildkit/issues/1896
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
@@ -1,201 +0,0 @@
name: "Release : Timely Executables"
on:
# Triggered manually
workflow_dispatch:
inputs:
tag:
description: "Timely version"
required: true
# Triggered by release-nightly-dev.yml / release-pr.yml
workflow_call:
inputs:
tag:
description: "Timely version"
required: true
type: string
secrets:
NC_GITHUB_TOKEN:
required: true
jobs:
build-executables:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.NC_GITHUB_TOKEN }}
repository: 'nocodb/nocodb-timely'
- name: Cache node modules
id: cache-npm
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Cache pkg modules
id: cache-pkg
uses: actions/cache@v3
env:
cache-name: cache-pkg
with:
# pkg cache files are stored in `~/.pkg-cache`
path: ~/.pkg-cache
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install QEMU and ldid
run: |
sudo apt update
# Install qemu
sudo apt install qemu binfmt-support qemu-user-static
# install ldid
git clone https://github.com/daeken/ldid.git
cd ./ldid
./make.sh
sudo cp ./ldid /usr/local/bin
- uses: actions/setup-node@v3
with:
node-version: 22.12.0
- name: Update nocodb-timely
env:
TAG: ${{ github.event.inputs.tag || inputs.tag }}
run: |
npm i -E nocodb-daily@$TAG
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
git commit package.json -m "Update to $TAG"
git tag $TAG
git push --tags
- name : Install dependencies and build executables
run: |
# install npm dependencies
npm i
# Copy sqlite binaries
# rsync -rvzhP ./binaries/binding/ ./node_modules/sqlite3/lib/binding/
# Build sqlite binaries for all platforms
./node_modules/.bin/node-pre-gyp install --directory=./node_modules/sqlite3 --target_platform=win32 --fallback-to-build --target_arch=x64 --target_libc=unknown
./node_modules/.bin/node-pre-gyp install --directory=./node_modules/sqlite3 --target_platform=win32 --fallback-to-build --target_arch=ia32 --target_libc=unknown
./node_modules/.bin/node-pre-gyp install --directory=./node_modules/sqlite3 --target_platform=darwin --fallback-to-build --target_arch=x64 --target_libc=unknown
./node_modules/.bin/node-pre-gyp install --directory=./node_modules/sqlite3 --target_platform=darwin --fallback-to-build --target_arch=arm64 --target_libc=unknown
./node_modules/.bin/node-pre-gyp install --directory=./node_modules/sqlite3 --target_platform=linux --fallback-to-build --target_arch=x64 --target_libc=glibc
./node_modules/.bin/node-pre-gyp install --directory=./node_modules/sqlite3 --target_platform=linux --fallback-to-build --target_arch=arm64 --target_libc=glibc
./node_modules/.bin/node-pre-gyp install --directory=./node_modules/sqlite3 --target_platform=linux --fallback-to-build --target_arch=x64 --target_libc=musl
./node_modules/.bin/node-pre-gyp install --directory=./node_modules/sqlite3 --target_platform=linux --fallback-to-build --target_arch=arm64 --target_libc=musl
# clean up code to optimize size
npx modclean --patterns="default:*" --ignore="nc-lib-gui-daily/**,nocodb-daily/**,dayjs/**,express-status-monitor/**,sqlite3/**,jsdom/**" --run
mkdir -p ./mac-dist
mkdir -p ./dist
# build darwin x64 executable
npm uninstall sharp
npm install --cpu=x64 --os=darwin sharp
npx --yes pkg@5.8.1 . --compress GZip -t node22-macos-x64 -o Noco-macos-x64
mv ./Noco-macos-x64 ./mac-dist/
# build darwin arm64 executable
npm uninstall sharp
npm install --cpu=arm64 --os=darwin sharp
npx --yes pkg@5.8.1 . --compress GZip -t node22-macos-arm64 -o Noco-macos-arm64
mv ./Noco-macos-arm64 ./mac-dist/
# build linux x64 executable
npm uninstall sharp
npm install --cpu=x64 --os=linux sharp
npx --yes pkg@5.8.1 . --compress GZip -t node22-linux-x64 -o Noco-linux-x64
mv ./Noco-linux-x64 ./dist/
# build linux arm64 executable
npm uninstall sharp
npm install --cpu=arm64 --os=linux sharp
npx --yes pkg@5.8.1 . --compress GZip -t node22-linux-arm64 -o Noco-linux-arm64
mv ./Noco-linux-arm64 ./dist/
# build windows x64 executable
npm uninstall sharp
npm install --cpu=x64 --os=win32 sharp
npx --yes pkg@5.8.1 . --compress GZip -t node22-win-x64 -o Noco-win-x64.exe
mv ./Noco-win-x64.exe ./dist/
# build windows arm64 executable
npm uninstall sharp
npm install --cpu=arm64 --os=win32 sharp
npx --yes pkg@5.8.1 . --compress GZip -t node22-win-arm64 -o Noco-win-arm64.exe
mv ./Noco-win-arm64.exe ./dist/
- name: Upload executables(except mac executables) to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.NC_GITHUB_TOKEN }}
file: dist/**
tag: ${{ github.event.inputs.tag || inputs.tag }}
overwrite: true
file_glob: true
repo_name: nocodb/nocodb-timely
- uses: actions/upload-artifact@master
with:
name: ${{ github.event.inputs.tag || inputs.tag }}
path: mac-dist
retention-days: 1
sign-mac-executables:
runs-on: macos-latest
needs: build-executables
steps:
- uses: actions/download-artifact@master
with:
name: ${{ github.event.inputs.tag || inputs.tag }}
path: mac-dist
- name: Sign macOS executables
run: |
/usr/bin/codesign --force -s - ./mac-dist/Noco-macos-arm64 -v
/usr/bin/codesign --force -s - ./mac-dist/Noco-macos-x64 -v
- uses: actions/upload-artifact@master
with:
name: ${{ format('{0}-signed', github.event.inputs.tag || inputs.tag) }}
path: mac-dist
retention-days: 1
publish-mac-executables:
needs: sign-mac-executables
runs-on: ubuntu-22.04
steps:
- uses: actions/download-artifact@master
with:
name: ${{ format('{0}-signed', github.event.inputs.tag || inputs.tag) }}
path: mac-dist
- name: Upload mac executables to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.NC_GITHUB_TOKEN }}
file: mac-dist/**
tag: ${{ github.event.inputs.tag || inputs.tag }}
overwrite: true
file_glob: true
repo_name: nocodb/nocodb-timely
-52
View File
@@ -1,52 +0,0 @@
name: "Sync changes back to develop branch from master"
on:
# Triggered manually
workflow_dispatch:
# Triggered by release-nocodb.yml
workflow_call:
jobs:
sync-to-develop:
runs-on: ubuntu-22.04
steps:
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 22.12.0
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- name: Checkout
uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
path: nocodb
- name: Prepare GH Cli
id: gh
run: |
wget https://github.com/cli/cli/releases/download/v2.33.0/gh_2.33.0_linux_amd64.tar.gz
tar -xvf gh_2.33.0_linux_amd64.tar.gz
GH=gh_2.33.0_linux_amd64/bin/gh
echo "GH=${GH}" >> $GITHUB_OUTPUT
- name: Sync Master to Develop
id: sync
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cd nocodb
git fetch --quiet --unshallow origin
git checkout master
# reset to origin/master
git reset --hard origin/master
: # Use the first 8 characters of the latest commit hash as the branch name
BRANCH_NAME=nc/$(git rev-list -n 1 HEAD | cut -c1-8)
git checkout -b $BRANCH_NAME
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
revertSDK=true node scripts/upgradeNocodbSdk.js
pnpm --filter=nocodb-sdk install --no-frozen-lockfile && pnpm --filter=nocodb-sdk run build && pnpm --filter=nocodb --filter=nc-gui --filter=playwright install --no-frozen-lockfile
git add .
git diff-index --quiet HEAD || git commit -m "chore: update sdk path"
git push origin $BRANCH_NAME
../${{ steps.gh.outputs.GH }} pr create --title "chore: post-release sync" --body "$(echo -e "This is an automated pull request to sync the master branch to develop.\nPlease review and merge this pull request if it looks good.")" --base develop --head $BRANCH_NAME
-82
View File
@@ -1,82 +0,0 @@
name: Deploy Uffizzi Preview
on:
workflow_run:
workflows:
- "PR Release"
types:
- completed
jobs:
cache-compose-file:
name: Cache Compose File
runs-on: ubuntu-22.04
if: ${{ github.event.workflow_run.conclusion == 'success' }}
outputs:
compose-file-cache-key: ${{ steps.hash.outputs.COMPOSE_FILE_HASH }}
git-ref: ${{ steps.event.outputs.GIT_REF }}
pr-number: ${{ steps.event.outputs.PR_NUMBER }}
action: ${{ steps.event.outputs.ACTION }}
steps:
- name: 'Download artifacts'
# Download artifacts from the workflow run that triggered this workflow.
# Token is required to download from a different workflow run.
uses: actions/download-artifact@v4
with:
path: preview-spec
pattern: preview-spec-*
merge-multiple: true
github-token: ${{ github.token }}
run-id: ${{ github.event.workflow_run.id }}
- name: 'Accept event from first stage'
run: cp preview-spec/event.json .
- name: Read Event into ENV
id: event
run: |
echo PR_NUMBER=$(jq '.number | tonumber' < event.json) >> $GITHUB_OUTPUT
echo ACTION=$(jq --raw-output '.action | tostring | [scan("\\w+")][0]' < event.json) >> $GITHUB_OUTPUT
echo GIT_REF=$(jq --raw-output '.pull_request.head.sha | tostring | [scan("\\w+")][0]' < event.json) >> $GITHUB_OUTPUT
- name: Hash Rendered Compose File
id: hash
# If the previous workflow was triggered by a PR close event, we will not have a compose file artifact.
if: ${{ steps.event.outputs.ACTION != 'closed' }}
run: |
cp preview-spec/docker-compose.rendered.yml .
echo "COMPOSE_FILE_HASH=$(md5sum docker-compose.rendered.yml | awk '{ print $1 }')" >> $GITHUB_OUTPUT
- name: Cache Rendered Compose File
if: ${{ steps.event.outputs.ACTION != 'closed' }}
uses: actions/cache@v3
with:
path: docker-compose.rendered.yml
key: ${{ steps.hash.outputs.COMPOSE_FILE_HASH }}
- name: DEBUG - Print Job Outputs
if: ${{ runner.debug }}
run: |
echo "PR number: ${{ steps.event.outputs.PR_NUMBER }}"
echo "Git Ref: ${{ steps.event.outputs.GIT_REF }}"
echo "Action: ${{ steps.event.outputs.ACTION }}"
echo "Compose file hash: ${{ steps.hash.outputs.COMPOSE_FILE_HASH }}"
cat event.json
deploy-uffizzi-preview:
name: Use Remote Workflow to Preview on Uffizzi
needs:
- cache-compose-file
if: ${{ github.event.workflow_run.conclusion == 'success' }}
uses: UffizziCloud/preview-action/.github/workflows/reusable.yaml@v2
with:
# If this workflow was triggered by a PR close event, cache-key will be an empty string
# and this reusable workflow will delete the preview deployment.
compose-file-cache-key: ${{ needs.cache-compose-file.outputs.compose-file-cache-key }}
compose-file-cache-path: docker-compose.rendered.yml
server: https://app.uffizzi.com
pr-number: ${{ needs.cache-compose-file.outputs.pr-number }}
permissions:
contents: read
pull-requests: write
id-token: write
-42
View File
@@ -1,42 +0,0 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Backend Unit Tests
on:
push:
branches: ["develop"]
paths:
- "packages/nocodb/**"
pull_request:
branches: ["develop"]
paths:
- "packages/nocodb/**"
jobs:
unit-tests:
runs-on: ubuntu-22.04
strategy:
matrix:
node-version: 22.12.0
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "pnpm"
- name: remove use-node-version from .npmrc
run: sed -i '/^use-node-version/d' .npmrc
- name: install dependencies
run: pnpm bootstrap
- name: run unit tests
working-directory: ./packages/nocodb
run: pnpm run unit-test
-48
View File
@@ -1,48 +0,0 @@
name: "Update SDK Path"
on:
# Triggered manually
workflow_dispatch:
# Triggered by release-nocodb.yml
workflow_call:
jobs:
release:
runs-on: ubuntu-22.04
steps:
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 22.12.0
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- run: |
sed -i '/^use-node-version/d' .npmrc
pnpm bootstrap
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v4.2.3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
signoff: true
branch: "bot/update-nocodb-sdk-path"
delete-branch: true
title: "Update nocodb-sdk to local path"
labels: "Bot: Automerge"
- name: Check outputs
run: |
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
- name: automerge
uses: "pascalgn/automerge-action@v0.15.5"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
PULL_REQUEST: "${{ steps.cpr.outputs.pull-request-number }}"
MERGE_LABELS: "Bot: Automerge"
-89
View File
@@ -1,89 +0,0 @@
#!/bin/bash
# script to build local docker image.
# highlevel steps involved
# 1. Stop and remove existing container and image
# 2. Install dependencies
# 3. Build nc-gui
# 3a. static build of nc-gui
# 3b. copy nc-gui build to nocodb dir
# 4. Build nocodb
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
LOG_FILE=${SCRIPT_DIR}/build-local-docker-image.log
ERROR=""
function stop_and_remove_container() {
# Stop and remove the existing container
docker stop nocodb-local >/dev/null 2>&1
docker rm nocodb-local >/dev/null 2>&1
}
function remove_image() {
# Remove the existing image
docker rmi nocodb-local >/dev/null 2>&1
}
function install_dependencies() {
# Install all dependencies
cd ${SCRIPT_DIR}
pnpm bootstrap || ERROR="install_dependencies failed"
}
function build_gui() {
# build nc-gui
export NODE_OPTIONS="--max_old_space_size=8192"
# generate static build of nc-gui
cd ${SCRIPT_DIR}/packages/nc-gui
pnpm run generate || ERROR="gui build failed"
}
function copy_gui_artifacts() {
# copy nc-gui build to nocodb dir
rsync -rvzh --delete ./dist/ ${SCRIPT_DIR}/packages/nocodb/docker/nc-gui/ || ERROR="copy_gui_artifacts failed"
}
function package_nocodb() {
# build nocodb ( pack nocodb-sdk and nc-gui )
cd ${SCRIPT_DIR}/packages/nocodb
pnpm run docker:build || ERROR="package_nocodb failed"
}
function build_image() {
# build docker
docker build . -f Dockerfile.local -t nocodb-local || ERROR="build_image failed"
}
function log_message() {
if [[ ${ERROR} != "" ]];
then
>&2 echo "build failed, Please check build-local-docker-image.log for more details"
>&2 echo "ERROR: ${ERROR}"
exit 1
else
echo 'docker image with tag "nocodb-local" built sussessfully. Use below sample command to run the container'
echo 'docker run -d -p 3333:8080 --name nocodb-local nocodb-local '
fi
}
echo "Info: Stopping and removing existing container and image" | tee ${LOG_FILE}
stop_and_remove_container
remove_image
echo "Info: Installing dependencies" | tee -a ${LOG_FILE}
install_dependencies 1>> ${LOG_FILE} 2>> ${LOG_FILE}
echo "Info: Building nc-gui" | tee -a ${LOG_FILE}
build_gui 1>> ${LOG_FILE} 2>> ${LOG_FILE}
echo "Info: Copy nc-gui build to nocodb dir" | tee -a ${LOG_FILE}
copy_gui_artifacts 1>> ${LOG_FILE} 2>> ${LOG_FILE}
echo "Info: Build nocodb, package nocodb-sdk and nc-gui" | tee -a ${LOG_FILE}
package_nocodb 1>> ${LOG_FILE} 2>> ${LOG_FILE}
if [[ ${ERROR} == "" ]]; then
echo "Info: Building docker image" | tee -a ${LOG_FILE}
build_image 1>> ${LOG_FILE} 2>> ${LOG_FILE}
fi
log_message | tee -a ${LOG_FILE}
-2
View File
@@ -1,2 +0,0 @@
charts/
Chart.lock
-23
View File
@@ -1,23 +0,0 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
-16
View File
@@ -1,16 +0,0 @@
apiVersion: v2
appVersion: 0.100.2
dependencies:
- condition: postgresql.enabled
name: postgresql
repository: https://charts.bitnami.com/bitnami
version: ~11.6.6
- condition: mysql.enabled
name: mysql
repository: https://charts.bitnami.com/bitnami
version: ~9.4.6
description: A Helm chart for Kubernetes
maintainers: []
name: nocodb
type: application
version: 0.3.0
-22
View File
@@ -1,22 +0,0 @@
1. Get the application URL by running these commands:
{{- if .Values.ingress.enabled }}
{{- range $host := .Values.ingress.hosts }}
{{- range .paths }}
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ . }}
{{- end }}
{{- end }}
{{- else if contains "NodePort" .Values.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "nocodb.fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT
{{- else if contains "LoadBalancer" .Values.service.type }}
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "nocodb.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "nocodb.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
echo http://$SERVICE_IP:{{ .Values.service.port }}
{{- else if contains "ClusterIP" .Values.service.type }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "nocodb.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
echo "Visit http://127.0.0.1:8080 to use your application"
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT
{{- end }}
-82
View File
@@ -1,82 +0,0 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "nocodb.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "nocodb.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "nocodb.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Common labels
*/}}
{{- define "nocodb.labels" -}}
helm.sh/chart: {{ include "nocodb.chart" . }}
{{ include "nocodb.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}
{{/*
Selector labels
*/}}
{{- define "nocodb.selectorLabels" -}}
app.kubernetes.io/name: {{ include "nocodb.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
{{/*
Create the name of the service account to use
*/}}
{{- define "nocodb.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "nocodb.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
{{- define "postgresHost" -}}
{{- printf "%s-postgresql" .Release.Name }}
{{- end }}
{{- define "postgresDatabase" -}}
{{- .Values.postgresql.auth.database }}
{{- end }}
{{- define "postgresUsername" -}}
{{- .Values.postgresql.auth.username }}
{{- end }}
{{- define "postgresPassword" -}}
{{- .Values.postgresql.auth.password }}
{{- end }}
{{- define "databaseUri" -}}
{{- printf "pg://%s:5432?u=%s&p=%s&d=%s" (include "postgresHost" .) (include "postgresUsername" .) (include "postgresPassword" .) (include "postgresDatabase" .) }}
{{- end }}
-13
View File
@@ -1,13 +0,0 @@
{{- if .Values.extraEnvs }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "nocodb.fullname" . }}
labels:
{{- include "nocodb.labels" . | nindent 4 }}
data:
{{- range $key, $value := .Values.extraEnvs }}
{{ $key }}: |-
{{- $value | nindent 4 }}
{{- end }}
{{- end }}
-77
View File
@@ -1,77 +0,0 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "nocodb.fullname" . }}
labels:
{{- include "nocodb.labels" . | nindent 4 }}
spec:
{{- if not .Values.autoscaling.enabled }}
replicas: {{ .Values.replicaCount }}
{{- end }}
selector:
matchLabels:
{{- include "nocodb.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "nocodb.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "nocodb.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- if .Values.storage.enabled }}
volumeMounts:
- name: {{ include "nocodb.fullname" . }}
mountPath: /usr/app/data
{{- end }}
envFrom:
- configMapRef:
name: {{ include "nocodb.fullname" . }}
- secretRef:
name: {{ include "nocodb.fullname" . }}
ports:
- name: http
containerPort: 8080
protocol: TCP
livenessProbe:
httpGet:
path: /
port: http
readinessProbe:
httpGet:
path: /
port: http
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.storage.enabled }}
volumes:
- name: {{ include "nocodb.fullname" . }}
persistentVolumeClaim:
claimName: {{ include "nocodb.fullname" . }}
{{- end }}
-28
View File
@@ -1,28 +0,0 @@
{{- if .Values.autoscaling.enabled }}
apiVersion: autoscaling/v2beta1
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "nocodb.fullname" . }}
labels:
{{- include "nocodb.labels" . | nindent 4 }}
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ include "nocodb.fullname" . }}
minReplicas: {{ .Values.autoscaling.minReplicas }}
maxReplicas: {{ .Values.autoscaling.maxReplicas }}
metrics:
{{- if .Values.autoscaling.targetCPUUtilizationPercentage }}
- type: Resource
resource:
name: cpu
targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
{{- end }}
{{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: memory
targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
{{- end }}
{{- end }}
-61
View File
@@ -1,61 +0,0 @@
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "nocodb.fullname" . -}}
{{- $svcPort := .Values.ingress.port -}}
{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }}
{{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }}
{{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}}
{{- end }}
{{- end }}
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1
{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1beta1
{{- else -}}
apiVersion: extensions/v1beta1
{{- end }}
kind: Ingress
metadata:
name: {{ $fullName }}
labels:
{{- include "nocodb.labels" . | nindent 4 }}
{{- with .Values.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
ingressClassName: {{ .Values.ingress.className }}
{{- end }}
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
- host: {{ .host | quote }}
http:
paths:
{{- range .paths }}
- path: {{ .path }}
{{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }}
pathType: {{ .pathType }}
{{- end }}
backend:
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
service:
name: {{ $fullName }}
port:
number: {{ $svcPort }}
{{- else }}
serviceName: {{ $fullName }}
servicePort: {{ $svcPort }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
-16
View File
@@ -1,16 +0,0 @@
{{ if .Values.storage.enabled }}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ include "nocodb.fullname" . }}
labels:
{{- include "nocodb.selectorLabels" . | nindent 8 }}
spec:
resources:
requests:
storage: {{ .Values.storage.size }}
storageClassName: {{ .Values.storage.storageClassName }}
accessModes:
{{- default (toYaml .Values.storage.accessModes) "- ReadWriteMany" | nindent 4 }}
volumeMode: Filesystem
{{ end }}
-13
View File
@@ -1,13 +0,0 @@
{{- if .Values.extraSecretEnvs }}
apiVersion: v1
kind: Secret
metadata:
name: {{ include "nocodb.fullname" . }}
labels:
{{- include "nocodb.labels" . | nindent 4 }}
data:
NC_DB: {{ include "databaseUri" . | b64enc}}
{{- range $key, $value := .Values.extraSecretEnvs }}
{{ $key }}: '{{ $value | b64enc }}'
{{- end }}
{{- end }}
-15
View File
@@ -1,15 +0,0 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "nocodb.fullname" . }}
labels:
{{- include "nocodb.labels" . | nindent 4 }}
spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.port }}
targetPort: http
protocol: TCP
name: http
selector:
{{- include "nocodb.selectorLabels" . | nindent 4 }}
@@ -1,12 +0,0 @@
{{- if .Values.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "nocodb.serviceAccountName" . }}
labels:
{{- include "nocodb.labels" . | nindent 4 }}
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
@@ -1,15 +0,0 @@
apiVersion: v1
kind: Pod
metadata:
name: "{{ include "nocodb.fullname" . }}-test-connection"
labels:
{{- include "nocodb.labels" . | nindent 4 }}
annotations:
"helm.sh/hook": test
spec:
containers:
- name: wget
image: busybox
command: ['wget']
args: ['{{ include "nocodb.fullname" . }}:{{ .Values.service.port }}']
restartPolicy: Never
-113
View File
@@ -1,113 +0,0 @@
# Default values for nocodb.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
replicaCount: 1
image:
repository: nocodb/nocodb
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: ""
imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""
serviceAccount:
# Specifies whether a service account should be created
create: false
# Annotations to add to the service account
annotations: {}
# The name of the service account to use.
# If not set and create is true, a name is generated using the fullname template
name: ""
podAnnotations: {}
podSecurityContext: {}
# fsGroup: 2000
securityContext: {}
# capabilities:
# drop:
# - ALL
# readOnlyRootFilesystem: true
# runAsNonRoot: true
# runAsUser: 1000
service:
type: ClusterIP
port: 8080
ingress:
enabled: false
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
hosts:
- host: chart-example.local
paths: []
tls: []
# - secretName: chart-example-tls
# hosts:
# - chart-example.local
resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi
autoscaling:
enabled: false
minReplicas: 1
maxReplicas: 100
targetCPUUtilizationPercentage: 80
# targetMemoryUtilizationPercentage: 80
nodeSelector: {}
tolerations: []
affinity: {}
extraEnvs:
NC_PUBLIC_URL: https://nocodb.local.org
extraSecretEnvs:
NC_AUTH_JWT_SECRET: secretString
NC_DB: "mysql2://mysql:3306?u=nocodb&p=secretPass&d=nocodb"
storage:
# If disabled, another persistent storage should be configured for attachments to work.
# We recommend setting NC_S3_BUCKET_NAME and other NC_S3* environment variables.
# Refer documentation for more details.
enabled: true
size: 3Gi
storageClassName: ""
postgresql:
enabled: false
auth:
database: nocodb
username: nocodb
password: secretPass
persistence:
size: 8Gi
mysql:
enabled: false
auth:
database: nocodb
username: nocodb
password: secretPass
persistence:
enabled: false
size: 8Gi
-10
View File
@@ -21,18 +21,8 @@
},
"web-types": "web-types.json",
"scripts": {
"build": "nuxt build",
"dev": "nuxt dev",
"generate": "nuxt generate",
"start": "node .output/server/index.mjs",
"lint": "eslint --ext \".js,.jsx,.ts,.tsx,.vue\" --fix --ignore-path .gitignore .",
"test": "vitest -c test/vite.config.ts",
"test:ui": "vitest -c test/vite.config.ts --ui",
"coverage": "vitest -c test/vite.config.ts run --coverage",
"build:copy": "pnpm run generate; rm -rf ../nc-lib-gui/lib/dist/; rsync -rvzh ./dist/ ../nc-lib-gui/lib/dist/",
"build:copy:publish": "pnpm run generate; rm -rf ../nc-lib-gui/lib/dist/; rsync -rvzh ./dist/ ../nc-lib-gui/lib/dist/; pnpm publish ../nc-lib-gui",
"ci:run": "export NODE_OPTIONS=\"--max_old_space_size=8192\"; pnpm install; pnpm run build; NUXT_PAGE_TRANSITION_DISABLE=true NUXT_PUBLIC_NC_BACKEND_URL=http://localhost:8080 pnpm run start &",
"ci:start": "export NODE_OPTIONS=\"--max_old_space_size=8192\"; NUXT_PAGE_TRANSITION_DISABLE=true NUXT_PUBLIC_NC_BACKEND_URL=http://localhost:8080 pnpm run start &",
"preinstall": "npx only-allow pnpm",
"postinstall": "nuxt prepare"
},
-95
View File
@@ -1,95 +0,0 @@
###########
# Litestream Builder
###########
FROM golang:bullseye AS lt-builder
WORKDIR /usr/src/
RUN apt-get update && apt-get install -y \
git \
make \
gcc \
libc-dev \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
# build litestream
RUN git clone https://github.com/benbjohnson/litestream.git litestream
RUN cd litestream && go install ./cmd/litestream
RUN cp $GOPATH/bin/litestream /usr/src/lt
###########
# Builder
###########
FROM node:22-slim AS builder
WORKDIR /usr/src/app
# Install dependencies required for node-gyp and other build tools
RUN apt-get update && apt-get install -y \
python3 \
python3-distutils \
python-is-python3 \
make \
g++ \
libssl-dev \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
RUN python3 --version && python --version
# Install pnpm
RUN corepack enable && corepack prepare pnpm@9.15.4 --activate
# Copy application dependency manifests to the container image.
COPY --link ./package.json ./package.json
COPY --link ./docker/main.js ./docker/main.js
COPY --link ./docker/start-litestream.sh /usr/src/appEntry/start.sh
COPY --link src/public/ ./docker/public/
# Configure pnpm to use hoisted node_modules for modclean compatibility
RUN echo "node-linker=hoisted" > .npmrc
# Install production dependencies, reduce node_modules size with modclean,
# remove sqlite deps, and add execute permission to start.sh
RUN pnpm install --prod --shamefully-hoist \
&& pnpm dlx modclean --patterns="default:*" --ignore="nc-lib-gui/**,dayjs/**,express-status-monitor/**,@azure/msal-node/dist/**,@react-email/**,@linear/**,jsdom/**,formdata-polyfill/**,**/lru-cache/**,**/@asamuzakjp/**,**/cssstyle/**" --run \
&& rm -rf ./node_modules/sqlite3/deps \
&& chmod +x /usr/src/appEntry/start.sh
##########
# Runner
##########
FROM node:22-slim
WORKDIR /usr/src/app
ENV LITESTREAM_S3_SKIP_VERIFY=false \
LITESTREAM_RETENTION=1440h \
LITESTREAM_RETENTION_CHECK_INTERVAL=72h \
LITESTREAM_SNAPSHOT_INTERVAL=24h \
LITESTREAM_SYNC_INTERVAL=60s \
NC_DOCKER=0.6 \
NC_TOOL_DIR=/usr/app/data/ \
NODE_ENV=production \
PORT=8080
# Install additional runtime dependencies
RUN apt-get update && apt-get install -y \
dumb-init \
curl \
wget \
&& curl -L "https://github.com/TomWright/dasel/releases/download/v2.8.1/dasel_linux_$(dpkg --print-architecture)" -o /usr/local/bin/dasel \
&& chmod +x /usr/local/bin/dasel \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
# Copy litestream binary and config file
COPY --link --from=lt-builder /usr/src/lt /usr/local/bin/litestream
COPY --link ./docker/litestream.yml /etc/litestream.yml
# Copy production code & main entry file
COPY --link --from=builder /usr/src/app/ /usr/src/app/
COPY --link --from=builder /usr/src/appEntry/ /usr/src/appEntry/
EXPOSE 8080
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
# Start Nocodb
CMD ["/usr/src/appEntry/start.sh"]
-73
View File
@@ -1,73 +0,0 @@
################
# NocoDB Builder
################
FROM node:22-slim AS builder
WORKDIR /usr/src/app
# Install dependencies required for node-gyp and other build tools
RUN apt-get update && apt-get install -y \
python3 \
python3-distutils \
python-is-python3 \
make \
g++ \
libssl-dev \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
RUN python3 --version && python --version
# Install pnpm
RUN corepack enable && corepack prepare pnpm@9.15.4 --activate
# Copy application dependency manifests to the container image.
COPY --link ./package.json ./package.json
COPY --link ./docker/main.js ./docker/index.js
COPY --link ./docker/start-local.sh /usr/src/appEntry/start.sh
COPY --link src/public/ ./docker/public/
COPY --link ./docker/nc-gui/ ./docker/nc-gui/
# Configure pnpm to use hoisted node_modules for modclean compatibility
RUN echo "node-linker=hoisted" > .npmrc
# Install production dependencies, reduce node_modules size with modclean,
# remove sqlite deps, and add execute permission to start.sh
# Remove workspace SDK reference (already bundled into main.js by rspack)
RUN node -e "const p=require('./package.json'); delete p.dependencies['nocodb-sdk']; require('fs').writeFileSync('./package.json', JSON.stringify(p, null, 2))"
RUN pnpm install --prod --shamefully-hoist \
&& pnpm dlx modclean --patterns="default:*" --ignore="nc-lib-gui/**,dayjs/**,express-status-monitor/**,@azure/msal-node/dist/**,@react-email/**,@linear/**,jsdom/**,formdata-polyfill/**,**/lru-cache/**,**/@asamuzakjp/**,**/cssstyle/**" --run \
&& rm -rf ./node_modules/sqlite3/deps \
&& chmod +x /usr/src/appEntry/start.sh
# Replace nc-lib-gui dist with the freshly built frontend
RUN rm -rf ./node_modules/nc-lib-gui/lib/dist \
&& cp -r ./docker/nc-gui ./node_modules/nc-lib-gui/lib/dist
########
# Runner
########
FROM node:22-slim
WORKDIR /usr/src/app
ENV NC_DOCKER=0.6 \
NC_TOOL_DIR=/usr/app/data/ \
NODE_ENV=production \
PORT=8080
# Install additional runtime dependencies
RUN apt-get update && apt-get install -y \
dumb-init \
curl \
wget \
&& curl -L "https://github.com/TomWright/dasel/releases/download/v2.8.1/dasel_linux_$(dpkg --print-architecture)" -o /usr/local/bin/dasel \
&& chmod +x /usr/local/bin/dasel \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
# Copy production code & main entry file
COPY --link --from=builder /usr/src/app/ /usr/src/app/
COPY --link --from=builder /usr/src/appEntry/ /usr/src/appEntry/
EXPOSE 8080
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
# Start NocoDB
CMD ["/usr/src/appEntry/start.sh"]
-124
View File
@@ -1,124 +0,0 @@
# Use Buildx cross-compilation
####################
# Litestream Builder
####################
FROM --platform=$BUILDPLATFORM golang:bookworm AS lt-builder
WORKDIR /usr/src/
# Install buildtime dependencies
RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y --no-install-recommends \
gcc \
git \
libc6-dev \
make \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
# Build litestream for the target platform
RUN git clone https://github.com/benbjohnson/litestream.git litestream \
&& cd litestream \
&& GOARCH=$(echo $TARGETPLATFORM | cut -d '/' -f 2) GOOS=$(echo $TARGETPLATFORM | cut -d '/' -f 1) go install ./cmd/litestream \
&& cp $GOPATH/bin/litestream /usr/local/bin/litestream
################
# NocoDB Builder
################
FROM --platform=$BUILDPLATFORM node:22-slim AS builder
WORKDIR /usr/src/app
# Install node-gyp dependencies and other build tools
RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y --no-install-recommends \
g++ \
make \
python-is-python3 \
python3 \
python3-distutils \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
# Install pnpm
RUN corepack enable && corepack prepare pnpm@9.15.4 --activate
# Copy application dependency manifests to the container image
COPY --link ./package.json ./package.json
COPY --link ./docker/main.js ./docker/main.js
COPY --link ./docker/start-litestream.sh /usr/src/appEntry/start.sh
COPY --link src/public/ ./docker/public/
COPY --link ./docker/nc-gui/ ./docker/nc-gui/
# Configure pnpm to use hoisted node_modules for modclean compatibility
RUN echo "node-linker=hoisted" > .npmrc
# Install production dependencies, reduce node_modules size with modclean,
# remove sqlite deps, and add execute permission to start.sh
RUN pnpm install --prod --shamefully-hoist \
&& pnpm dlx modclean --patterns="default:*" --ignore="nc-lib-gui/**,dayjs/**,express-status-monitor/**,@azure/msal-node/dist/**,@react-email/**,jsdom/**,formdata-polyfill/**,**/lru-cache/**,**/@asamuzakjp/**,**/cssstyle/**" --run \
&& rm -rf ./node_modules/sqlite3/deps \
&& chmod +x /usr/src/appEntry/start.sh
#############################
# Binary Dependencies Builder
#############################
FROM --platform=$TARGETPLATFORM node:22-slim AS bin-builder
WORKDIR /usr/src/app
# Install node-gyp dependencies and other build tools
RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y --no-install-recommends \
g++ \
jq \
make \
python3 \
python3-distutils \
python-is-python3 \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
# Copy package.json to extract dependency versions
COPY --link ./package.json ./package-copy.json
# Install sqlite3 for the target platform to copy to the final image
RUN SQLITE3_VERSION=$(jq -r '.dependencies["sqlite3"]' /usr/src/app/package-copy.json) \
&& SHARP_VERSION=$(jq -r '.dependencies["sharp"]' /usr/src/app/package-copy.json) \
&& npm init -y && npm install sqlite3@$SQLITE3_VERSION sharp@$SHARP_VERSION
########
# Runner
########
FROM --platform=$TARGETPLATFORM node:22-slim
WORKDIR /usr/src/app
ENV LITESTREAM_S3_SKIP_VERIFY=false \
LITESTREAM_RETENTION=1440h \
LITESTREAM_RETENTION_CHECK_INTERVAL=72h \
LITESTREAM_SNAPSHOT_INTERVAL=24h \
LITESTREAM_SYNC_INTERVAL=60s \
NC_DOCKER=0.6 \
NC_TOOL_DIR=/usr/app/data/ \
NODE_ENV=production \
PORT=8080
# Install runtime dependencies
RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y --no-install-recommends \
ca-certificates `# required by wget for HTTPS support` \
curl \
dumb-init \
wget `# for convenience of downstream users` \
&& curl -L "https://github.com/TomWright/dasel/releases/download/v2.8.1/dasel_linux_$(dpkg --print-architecture)" -o /usr/local/bin/dasel \
&& chmod +x /usr/local/bin/dasel \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
# Copy litestream binary and config file
COPY --link --from=lt-builder /usr/local/bin/litestream /usr/local/bin/litestream
COPY --link ./docker/litestream.yml /etc/litestream.yml
# Copy production code & main entry file
COPY --link --from=builder /usr/src/app/ /usr/src/app/
COPY --link --from=builder /usr/src/appEntry/ /usr/src/appEntry/
COPY --link --from=bin-builder /usr/src/app/node_modules/sqlite3/ /usr/src/app/node_modules/sqlite3/
COPY --link --from=bin-builder /usr/src/app/node_modules/sharp/ /usr/src/app/node_modules/sharp/
EXPOSE 8080
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
# Start NocoDB
CMD ["/usr/src/appEntry/start.sh"]
-90
View File
@@ -1,90 +0,0 @@
const path = require('path');
const { rspack } = require('@rspack/core');
const nodeExternals = require('webpack-node-externals');
module.exports = {
entry: './src/run/dockerEntry.ts',
module: {
rules: [
{
test: /\.node$/,
loader: 'node-loader',
options: {
name: '[path][name].[ext]',
},
},
{
test: /\.tsx?$/,
exclude: /node_modules/,
loader: 'builtin:swc-loader',
options: {
jsc: {
parser: {
syntax: 'typescript',
tsx: true,
decorators: true,
dynamicImport: true,
},
transform: {
legacyDecorator: true,
decoratorMetadata: true,
},
target: 'es2017',
loose: true,
externalHelpers: false,
keepClassNames: true,
},
module: {
type: 'commonjs',
strict: false,
strictMode: true,
lazy: false,
noInterop: false,
},
},
},
],
},
resolve: {
extensions: ['.tsx', '.ts', '.js', '.json'],
tsConfig: {
configFile: path.resolve('tsconfig.json'),
},
},
output: {
path: path.resolve('./docker'),
filename: 'main.js',
library: 'libs',
libraryTarget: 'umd',
globalObject: "typeof self !== 'undefined' ? self : this",
},
optimization: {
minimize: true, //Update this to true or false
minimizer: [
new rspack.SwcJsMinimizerRspackPlugin({
minimizerOptions: {
compress: {
keep_classnames: true,
},
mangle: {
keep_classnames: true,
},
},
}),
],
nodeEnv: false,
},
externals: [
nodeExternals({
allowlist: ['nocodb-sdk'],
}),
],
plugins: [
new rspack.EnvironmentPlugin({
EE: true,
}),
],
target: 'node',
node: {
__dirname: false,
},
};
-7
View File
@@ -1,7 +0,0 @@
#!/bin/sh
if [ ! -d "${NC_TOOL_DIR}" ]; then
mkdir -p "$NC_TOOL_DIR"
fi
node docker/index.js
-6
View File
@@ -20,14 +20,9 @@
},
"license": "Sustainable Use License",
"scripts": {
"build": "pnpm run docker:build",
"build:obfuscate": "EE=true rspack --config rspack.config.js",
"build:cli:module": "EE=true rspack --config rspack.cli.config.js",
"obfuscate:build:publish": "pnpm run build:obfuscate && pnpm publish .",
"registerIntegrations": "node build-utils/registerIntegrations.js",
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
"start": "pnpm run watch:run",
"start:prod": "node docker/main",
"lint": "eslint \"src/**/*.ts\" --fix",
"test": "jest --runInBand --forceExit --passWithNoTests",
"test:watch": "jest --watch",
@@ -37,7 +32,6 @@
"watch:run": "cross-env NODE_ENV=development NC_DISABLE_TELE=true ENTRYPOINT=src/run/docker rspack --config rspack.dev.config.js",
"watch:run:mysql": "cross-env NODE_ENV=development NC_DISABLE_TELE=true ENTRYPOINT=src/run/dockerRunMysql rspack --config rspack.dev.config.js",
"watch:run:pg": "cross-env NODE_ENV=development NC_DISABLE_TELE=true ENTRYPOINT=src/run/dockerRunPG rspack --config rspack.dev.config.js",
"docker:build": "EE=\"true-xc-test\" rspack --config docker/rspack.config.js",
"mail": "email dev --dir src/services/mail/templates --port 8001"
},
"dependencies": {
-97
View File
@@ -1,97 +0,0 @@
const { resolve } = require('path');
const { rspack } = require('@rspack/core');
const nodeExternals = require('webpack-node-externals');
module.exports = {
entry: './src/cli.ts',
module: {
rules: [
{
test: /\.node$/,
loader: 'node-loader',
options: {
name: '[path][name].[ext]',
},
},
{
test: /\.tsx?$/,
exclude: /node_modules/,
loader: 'builtin:swc-loader',
options: {
sourceMaps: false,
jsc: {
parser: {
syntax: 'typescript',
tsx: true,
decorators: true,
dynamicImport: true,
},
transform: {
legacyDecorator: true,
decoratorMetadata: true,
},
target: 'es2017',
loose: true,
externalHelpers: false,
keepClassNames: true,
},
module: {
type: 'commonjs',
strict: false,
strictMode: true,
lazy: false,
noInterop: false,
},
},
},
],
},
optimization: {
minimize: true,
minimizer: [
new rspack.SwcJsMinimizerRspackPlugin({
minimizerOptions: {
format: {
comments: false,
},
},
}),
],
nodeEnv: false,
},
externals: [
nodeExternals({
allowlist: ['nocodb-sdk'],
}),
],
resolve: {
extensions: ['.tsx', '.ts', '.js', '.json'],
tsConfig: {
configFile: resolve('tsconfig.json'),
},
alias: {
'@noco-local-integrations': resolve(__dirname, '../noco-integrations/packages'),
},
},
mode: 'production',
output: {
filename: 'cli.js',
path: resolve(__dirname, '..', 'nc-secret-mgr', 'src/nocodb'),
library: 'libs',
libraryTarget: 'umd',
globalObject: "typeof self !== 'undefined' ? self : this",
},
node: {
__dirname: false,
},
plugins: [
new rspack.EnvironmentPlugin({
EE: true,
}),
new rspack.BannerPlugin({
banner: 'This is a generated file. Do not edit',
entryOnly: true,
}),
],
target: 'node',
};
-106
View File
@@ -1,106 +0,0 @@
const { resolve } = require('path');
const { rspack } = require('@rspack/core');
const nodeExternals = require('webpack-node-externals');
const { TsCheckerRspackPlugin } = require('ts-checker-rspack-plugin');
module.exports = {
entry: './src/index.ts',
module: {
rules: [
{
test: /\.node$/,
loader: 'node-loader',
options: {
name: '[path][name].[ext]',
},
},
{
test: /\.tsx?$/,
exclude: /node_modules/,
loader: 'builtin:swc-loader',
options: {
sourceMaps: false,
jsc: {
parser: {
syntax: 'typescript',
tsx: true,
decorators: true,
dynamicImport: true,
},
transform: {
legacyDecorator: true,
decoratorMetadata: true,
},
target: 'es2017',
loose: true,
externalHelpers: false,
keepClassNames: true,
},
module: {
type: 'commonjs',
strict: false,
strictMode: true,
lazy: false,
noInterop: false,
},
},
},
],
},
optimization: {
minimize: true, //Update this to true or false
minimizer: [
new rspack.SwcJsMinimizerRspackPlugin({
minimizerOptions: {
compress: {
keep_classnames: true,
},
mangle: {
keep_classnames: true,
},
},
}),
],
nodeEnv: false,
},
externals: [
nodeExternals({
allowlist: ['nocodb-sdk'],
}),
],
resolve: {
extensions: ['.tsx', '.ts', '.js', '.json', '.node'],
tsConfig: {
configFile: resolve('tsconfig.json'),
},
alias: {
'@noco-local-integrations': resolve(__dirname, '../noco-integrations/packages'),
},
},
mode: 'production',
output: {
filename: 'bundle.js',
path: resolve(__dirname, 'dist'),
library: 'libs',
libraryTarget: 'umd',
globalObject: "typeof self !== 'undefined' ? self : this",
},
node: {
__dirname: false,
},
plugins: [
new rspack.EnvironmentPlugin({
EE: true,
}),
new rspack.CopyRspackPlugin({
patterns: [{ from: 'src/public', to: 'public' }],
}),
new TsCheckerRspackPlugin({
typescript: {
configFile: resolve('tsconfig.json'),
},
}),
],
target: 'node',
};
-100
View File
@@ -1,100 +0,0 @@
const path = require('path');
const { rspack } = require('@rspack/core');
const nodeExternals = require('webpack-node-externals');
module.exports = {
entry: './src/run/timely.ts',
module: {
rules: [
{
test: /\.node$/,
loader: 'node-loader',
options: {
name: '[path][name].[ext]',
},
},
{
test: /\.tsx?$/,
exclude: /node_modules/,
loader: 'builtin:swc-loader',
options: {
sourceMaps: false,
jsc: {
parser: {
syntax: 'typescript',
tsx: true,
decorators: true,
dynamicImport: true,
},
transform: {
legacyDecorator: true,
decoratorMetadata: true,
},
target: 'es2017',
loose: true,
externalHelpers: false,
keepClassNames: true,
},
module: {
type: 'commonjs',
strict: false,
strictMode: true,
lazy: false,
noInterop: false,
},
},
},
],
},
optimization: {
minimize: true, //Update this to true or false
minimizer: [
new rspack.SwcJsMinimizerRspackPlugin({
minimizerOptions: {
compress: {
keep_classnames: true,
},
mangle: {
keep_classnames: true,
},
},
}),
],
nodeEnv: false,
},
externals: [
nodeExternals({
allowlist: ['nocodb-sdk'],
}),
],
resolve: {
extensions: ['.tsx', '.ts', '.js', '.json', '.node'],
tsConfig: {
configFile: path.resolve('tsconfig.json'),
},
alias: {
'@noco-local-integrations': path.resolve(__dirname, '../noco-integrations/packages'),
},
},
mode: 'production',
output: {
filename: 'main.js',
path: path.resolve(__dirname, 'docker'),
library: 'libs',
libraryTarget: 'umd',
globalObject: "typeof self !== 'undefined' ? self : this",
},
node: {
__dirname: false,
},
plugins: [
new rspack.EnvironmentPlugin({
EE: true,
}),
new rspack.CopyRspackPlugin({
patterns: [{ from: 'src/public', to: 'public' }],
}),
],
target: 'node',
};
-14
View File
@@ -1,14 +0,0 @@
apt-get update && apt-get install -y wget
wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
&& tar -C /usr/local/bin -xzvf dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
&& rm dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz
echo "waiting for MSSQL........... "
dockerize -wait http://$DOCKER_DB_HOST:80 -wait-retry-interval 5s -timeout 20m
echo "MSSQL is UP >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
-16
View File
@@ -1,16 +0,0 @@
const fs = require('fs')
const path = require('path')
const packageJson = JSON.parse(fs.readFileSync(path.join(__dirname, '..', 'packages', 'nc-lib-gui', 'package.json'), 'utf8'))
if (process.env.targetEnv === 'DEV') {
// nightly build
// e.g. 0.84.2-20220220-1250
// pr build
// e.g. 0.84.2-pr-1234-20220220-1250
packageJson.version = `${packageJson.version}-${process.env.targetVersion}`
packageJson.name += '-daily'
} else {
packageJson.version = process.env.targetVersion
}
fs.writeFileSync(path.join(__dirname, '..', 'packages', 'nc-lib-gui', 'package.json'), JSON.stringify(packageJson, 0, 2))
-16
View File
@@ -1,16 +0,0 @@
const fs = require('fs')
const path = require('path')
const packageJson = JSON.parse(fs.readFileSync(path.join(__dirname, '..', 'packages', 'nocodb-sdk', 'package.json'), 'utf8'))
if (process.env.targetEnv === 'DEV') {
// nightly build
// e.g. 0.84.2-20220220-1250
// pr build
// e.g. 0.84.2-pr-1234-20220220-1250
packageJson.version = `${packageJson.version}-${process.env.targetVersion}`
packageJson.name += '-daily'
} else {
packageJson.version = process.env.targetVersion
}
fs.writeFileSync(path.join(__dirname, '..', 'packages', 'nocodb-sdk', 'package.json'), JSON.stringify(packageJson, 0, 2))
-8
View File
@@ -1,8 +0,0 @@
const path = require('path');
process.env.NC_BINARY_BUILD = 'true';
process.env.NODE_ENV = process.env.NODE_ENV || 'production';
process.env.NC_GUI_DIST_PATH =
process.env.NC_GUI_DIST_PATH ||
path.join(path.dirname(require.resolve('nocodb/package.json')), 'docker', 'nc-gui');
require("nocodb/dist/bundle.js");
-43
View File
@@ -1,43 +0,0 @@
{
"name": "Noco",
"version": "1.0.0",
"description": "",
"main": "index.js",
"bin": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node index.js",
"upgrade": "npm uninstall --save nocodb && npm install --save nocodb",
"build": "npx pkg . --out-path dist --compress GZip"
},
"pkg": {
"assets": [
"node_modules/**/*"
],
"targets": [
"node18-linux-arm64",
"node18-macos-arm64",
"node18-win-arm64",
"node18-linux-x64",
"node18-macos-x64",
"node18-win-x64"
]
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"@nestjs/common": "^10.4.17",
"@nestjs/core": "^10.4.17",
"cors": "^2.8.5",
"express": "^4.21.2",
"nocodb": "0.264.8",
"isomorphic-dompurify": "2.25.0"
},
"overrides": {
"sqlite3": "5.1.6"
},
"devDependencies": {
"@mapbox/node-pre-gyp": "1.0.11"
}
}
-19
View File
@@ -1,19 +0,0 @@
FROM ghcr.io/actions/actions-runner:latest
USER root
# Install dependencies
RUN apt-get update && apt-get install -y \
libnss3 libatk-bridge2.0-0 libdrm-dev libxkbcommon-dev libgbm-dev libasound-dev \
libatspi2.0-0 libxshmfence-dev python3 python3-pip curl zip sudo rsync jq \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
# Install Node.js (and npm, which includes npx)
RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - && \
apt-get install -y nodejs && \
apt-get clean && rm -rf /var/lib/apt/lists/*
# Install Playwright
RUN npx playwright install --with-deps chromium
USER runner
@@ -1,35 +0,0 @@
#!/bin/bash
# this script is intended to run in ci/cd job
# it checks if node and pnpm is installed
# and sets github env variable to skip installation
# this is suitable for self-hosted runners with
# docker image created from /Users/rajanishgj/Documents/GitHub/nocohub/tests/docker/Dockerfile
#
NC_REQ_NODE_V="22.12.0"
NC_REQ_PNPM_V="8.8.0"
NODE_PATH="/home/docker/actions-runner/_work/_tool/node/${NC_REQ_NODE_V}/x64/bin/node"
PNPM_PATH="/root/setup-pnpm/node_modules/.bin/pnpm"
NC_NODE_V=$($NODE_PATH -v || echo "error")
NC_PNPM_V=$($PNPM_PATH -v || echo "error")
if [[ $NC_NODE_V == *$NC_REQ_NODE_V* ]]; then
PATH=$PATH:$(dirname $NODE_PATH)
SETUP_NODE=false
fi
if [[ $NC_PNPM_V == $NC_REQ_PNPM_V ]]; then
PATH=$PATH:$(dirname $PNPM_PATH)
SETUP_PNPM=false
fi
echo "SETUP_NODE=${SETUP_NODE:-true}" >> $GITHUB_ENV
echo "SETUP_PNPM=${SETUP_PNPM:-true}" >> $GITHUB_ENV
echo "NC_REQ_NODE_V=${NC_REQ_NODE_V}" >> $GITHUB_ENV
echo "NC_REQ_PNPM_V=${NC_REQ_PNPM_V}" >> $GITHUB_ENV
echo "NC_NODE_V=${NC_NODE_V}" >> $GITHUB_ENV
echo "NC_PNPM_V=${NC_PNPM_V}" >> $GITHUB_ENV
echo "PATH=${PATH}" >> $GITHUB_ENV
echo "completed check node and pnpm installation"
-50
View File
@@ -1,50 +0,0 @@
template:
spec:
initContainers:
- name: init-dind-externals
image: runner:latest
imagePullPolicy: Never
command:
["cp", "-r", "-v", "/home/runner/externals/.", "/home/runner/tmpDir/"]
volumeMounts:
- name: dind-externals
mountPath: /home/runner/tmpDir
containers:
- name: runner
image: runner:latest
imagePullPolicy: Never
command: ["/home/runner/run.sh"]
env:
- name: DOCKER_HOST
value: unix:///run/docker/docker.sock
volumeMounts:
- name: work
mountPath: /home/runner/_work
- name: dind-sock
mountPath: /run/docker
readOnly: true
- name: dind
image: docker:dind
args:
- dockerd
- --host=unix:///run/docker/docker.sock
- --group=$(DOCKER_GROUP_GID)
env:
- name: DOCKER_GROUP_GID
value: "123"
securityContext:
privileged: true
volumeMounts:
- name: work
mountPath: /home/runner/_work
- name: dind-sock
mountPath: /run/docker
- name: dind-externals
mountPath: /home/runner/externals
volumes:
- name: work
emptyDir: {}
- name: dind-sock
emptyDir: {}
- name: dind-externals
emptyDir: {}
-14
View File
@@ -1,14 +0,0 @@
const fs = require('fs')
const path = require('path')
const packageJsonPath = path.join(__dirname, '..', 'packages', 'nc-secret-mgr', 'package.json')
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'))
if (!process.env.targetVersion) {
console.error('Error: targetVersion environment variable is not defined.');
process.exit(1);
}
packageJson.version = process.env.targetVersion
fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2))
-49
View File
@@ -1,49 +0,0 @@
const fs = require('fs')
const path = require('path')
const execSync = require('child_process').execSync;
// extract latest version from package.json
const ncLibPackage = JSON.parse(fs.readFileSync(path.join(__dirname, '..', 'packages', 'nc-lib-gui', 'package.json')))
const replacePackageName = (filePath) => {
return new Promise((resolve, reject) => {
return fs.readFile(filePath, 'utf8', function (err, data) {
if (err) return reject(err)
var result = data.replace(/nc-lib-gui/g, ncLibPackage.name);
return fs.writeFile(filePath, result, 'utf8', function (err) {
if (err) return reject(err)
return resolve()
});
});
})
}
const bumbVersionAndSave = () => {
// upgrade nc-lib-gui version in nocodb
execSync(`pnpm --filter=nocodb install --ignore-scripts ${ncLibPackage.name}@${ncLibPackage.version}`, {});
const nocodbPackageFilePath = path.join(__dirname, '..', 'packages', 'nocodb', 'package.json')
const nocoLibPackage = JSON.parse(fs.readFileSync(nocodbPackageFilePath))
if (process.env.targetEnv === 'DEV') {
nocoLibPackage.name = `${nocoLibPackage.name}-daily`
}
nocoLibPackage.version = ncLibPackage.version
fs.writeFileSync(nocodbPackageFilePath, JSON.stringify(nocoLibPackage, null, 2));
}
if (process.env.targetEnv === 'DEV') {
// replace nc-lib-gui by nc-lib-gui-daily if it is nightly build / pr release
const filePaths = [
path.join(__dirname, '..', 'packages', 'nocodb', 'Dockerfile'),
path.join(__dirname, '..', 'packages', 'nocodb', 'package.json'),
path.join(__dirname, '..', 'packages', 'nocodb', 'src', 'Noco.ts'),
path.join(__dirname, '..', 'packages', 'nocodb', 'src', 'nocobuild.ts'),
path.join(__dirname, '..', 'packages', 'nocodb', 'src', 'middlewares', 'gui', 'gui.middleware.ts'),
]
Promise.all(filePaths.map(filePath => { return replacePackageName(filePath) })).then(() => {
bumbVersionAndSave();
})
} else {
bumbVersionAndSave();
}
-98
View File
@@ -1,98 +0,0 @@
const fs = require('fs')
const path = require('path');
const execSync = require('child_process').execSync;
// extract latest version from package.json
const nocodbSdkPackage = JSON.parse(fs.readFileSync(path.join(__dirname, '..', 'packages', 'nocodb-sdk', 'package.json'), 'utf8'))
if (process.env.revertSDK === 'true') {
nocodbSdkPackage.version = 'workspace:^';
}
const replacePackageName = (filePath) => {
return new Promise((resolve, reject) => {
return fs.readFile(filePath, 'utf8', function (err, data) {
if (err) return reject(err)
var result = data.replace(/nocodb-sdk/g, nocodbSdkPackage.name);
return fs.writeFile(filePath, result, 'utf8', function (err) {
if (err) return reject(err)
return resolve()
});
});
})
}
const replacePackageVersion = (filePath) => {
return new Promise((resolve, reject) => {
return fs.readFile(filePath, 'utf8', function (err, data) {
if (err) return reject(err)
const rgx = new RegExp(`"${nocodbSdkPackage.name}": ".*"`, "g");
var result = data.replace(rgx, `"${nocodbSdkPackage.name}": "${nocodbSdkPackage.version}"`);
return fs.writeFile(filePath, result, 'utf8', function (err) {
if (err) return reject(err)
return resolve()
});
});
})
}
const bumbVersionAndSave = () => {
// upgrade nocodb-sdk version in nocodb & nc-gui
return Promise.all([
replacePackageVersion(path.join(__dirname, '..', 'packages', 'nocodb', 'package.json')),
replacePackageVersion(path.join(__dirname, '..', 'packages', 'nc-gui', 'package.json')),
])
}
const dfs = function(dir) {
var res = [];
var list = fs.readdirSync(dir);
list.forEach(function(file) {
if (['node_modules', 'build'].includes(file)) return;
file = dir + '/' + file;
var stat = fs.statSync(file);
if (stat && stat.isDirectory()) {
res = res.concat(dfs(file));
} else {
const ext = path.extname(file).toLowerCase()
if (ext == '.vue' || ext == '.ts' || ext == '.js') {
res.push(file);
}
}
})
return res;
}
const searchAndReplace = (target) => {
let list = [
...dfs(path.resolve(path.join(__dirname, '..', 'packages', 'nc-gui'))),
...dfs(path.resolve(path.join(__dirname, '..', 'packages', 'nocodb'))),
...dfs(path.resolve(path.join(__dirname, '..', 'tests', 'playwright'))),
path.join(__dirname, '..', 'packages', 'nc-gui', 'package.json'),
path.join(__dirname, '..', 'packages', 'nocodb', 'package.json'),
path.join(__dirname, '..', 'tests', 'playwright', 'package.json'),
]
return Promise.all(list.map(d => {
return new Promise((resolve, reject) => {
fs.readFile(d, function(err, content) {
if (err) reject(err)
if (content.indexOf(target) > -1) {
resolve(replacePackageName(d))
} else {
resolve()
}
})
})
}))
}
if (process.env.targetEnv === 'DEV') {
// replace nocodb-sdk by nocodb-sdk-daily if it is nightly build / pr build
searchAndReplace('nocodb-sdk')
.then(() => {
bumbVersionAndSave()
})
} else {
bumbVersionAndSave()
}
-54
View File
@@ -1,54 +0,0 @@
# base
FROM ubuntu:22.04
# set the github runner version
ARG RUNNER_VERSION="2.306.0"
# Get the base image of Node version 18
FROM node:18
# Get the latest version of Playwright
FROM mcr.microsoft.com/playwright:v1.32.2-focal
# Set the work directory for the application
WORKDIR /app
# Set the environment path to node_modules/.bin
ENV PATH /app/node_modules/.bin:$PATH
# Get the needed libraries to run Playwright
RUN apt-get update && apt-get -y install libnss3 libatk-bridge2.0-0 libdrm-dev libxkbcommon-dev libgbm-dev libasound-dev libatspi2.0-0 libxshmfence-dev python-is-python3
RUN apt-get update && apt-get -y install sudo curl ca-certificates gnupg && curl -fsSL https://www.postgresql.org/media/keys/ACCC4CF8.asc|sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/postgresql.gpg && sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' && apt-get update
# Install PostgreSQL
RUN apt-get update && \
apt-get -y install gnupg gnupg2 gnupg1 -y postgresql-14
# update the base packages and add a non-sudo user
RUN apt-get update -y && apt-get upgrade -y && useradd -m docker
# install python and the packages the your code depends on along with jq so we can parse JSON
# add additional packages as necessary
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
curl jq build-essential libssl-dev libffi-dev python3 python3-venv python3-dev python3-pip
# cd into the user directory, download and unzip the github actions runner
RUN cd /home/docker && mkdir actions-runner && cd actions-runner \
&& curl -O -L https://github.com/actions/runner/releases/download/v2.306.0/actions-runner-linux-x64-2.306.0.tar.gz \
&& tar xzf ./actions-runner-linux-x64-2.306.0.tar.gz
# install some additional dependencies
RUN chown -R docker ~docker && /home/docker/actions-runner/bin/installdependencies.sh
RUN npx playwright install --with-deps
# copy over the start.sh script
COPY start.sh start.sh
# make the script executable
RUN chmod +x start.sh
# set the entrypoint to the start.sh script
ENTRYPOINT ["./start.sh"]
-4
View File
@@ -1,4 +0,0 @@
docker build --tag mustafapc19/ci .
docker run --detach --env REG_TOKEN="AIRGTGSSUWA7JFNI57OADLTEW2EGO" --name runner mustafapc19/ci
-38
View File
@@ -1,38 +0,0 @@
#!/bin/bash
REG_TOKEN=$REG_TOKEN
# Create user named 'github-runner' and password as 'password'
adduser github-runner --disabled-password --gecos ""
usermod --password $(echo '.KsZG.v=SNrA#;j' | openssl passwd -1 -stdin) github-runner
sudo usermod -aG sudo github-runner
su - github-runner
# Install dependencies
sudo apt-get -y update
sudo apt-get -y install ca-certificates curl gnupg
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg
echo \
"deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
"$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get -y update
sudo apt-get -y install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
#swap
sudo fallocate -l 8G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
sudo cp /etc/fstab /etc/fstab.bak
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
# Install ci container
sudo docker run --detach --env REG_TOKEN="${REG_TOKEN}" --name runner mustafapc19/ci
-26
View File
@@ -1,26 +0,0 @@
#!/bin/bash
service postgresql start && \
sudo -u postgres psql -c "ALTER USER postgres WITH PASSWORD 'password';" && \
sudo -u postgres psql -c "ALTER USER postgres WITH SUPERUSER;" && \
sudo service postgresql restart
export RUNNER_ALLOW_RUNASROOT="1"
REG_TOKEN=$REG_TOKEN
DEFAULT_RUNNER_NAME="$(cat /etc/hostname)"
cd /home/docker/actions-runner
./config.sh --url https://github.com/nocodb/nocohub --token ${REG_TOKEN} --name ${DEFAULT_RUNNER_NAME}
cleanup() {
echo "Removing runner..."
./config.sh remove --unattended --token ${REG_TOKEN}
}
trap 'cleanup; exit 130' INT
trap 'cleanup; exit 143' TERM
./run.sh & wait $!