Browse Source

chore: nightly docker build action without npm package deployment

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/9645/head
Pranav C 2 months ago
parent
commit
56b5b26ff5
  1. 45
      .github/workflows/release-timely-docker.yml
  2. 57
      packages/nocodb/webpack.timely.config.js

45
.github/workflows/release-timely-docker.yml

@ -86,33 +86,28 @@ jobs:
with: with:
node-version: 18.19.1 node-version: 18.19.1
- name: install dependencies
run: pnpm bootstrap
- name: Build gui and sdk - name: Build gui and sdk
run: | run: |
export NODE_OPTIONS="--max_old_space_size=16384"
pnpm install --ignore-scripts --no-frozen-lockfile --ignore-workspace && pnpm bootstrap &&
pnpm run build && cd packages/nc-gui &&
pnpm --filter=nc-gui install --ignore-scripts --no-frozen-lockfile && pnpm run generate
pnpm --filter=nocodb-sdk install --ignore-scripts --no-frozen-lockfile
working-directory: ${{ env.working-directory }} # copy build to nocodb
rsync -rvzh ./ee/dist/ ../nocodb/docker/nc-gui/
- name: upgrade packages for nightly build or pr build
if: ${{ github.event.inputs.targetEnv == 'DEV' || inputs.targetEnv == 'DEV' }}
run: | - name: build nocodb
export NODE_OPTIONS="--max_old_space_size=16384" if: ${{ ( github.event_name == 'schedule' ) || ( github.event.inputs.services_to_deploy == 'main_only' || github.event.inputs.services_to_deploy == 'all' ) }}
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 and docker files
run: | run: |
pnpm install --ignore-scripts --no-frozen-lockfile # build nocodb ( pack nocodb-sdk and nc-gui )
pnpm run docker:build cd packages/nocodb &&
working-directory: ${{ env.working-directory }} EE=true pnpm exec webpack --config webpack.timely.config.js &&
# remove bundled libraries (nocodb-sdk, knex-snowflake)
pnpm uninstall --save-prod nocodb-sdk knex-snowflake knex-databricks
- name: Set up QEMU - name: Set up QEMU
uses: docker/setup-qemu-action@v2.1.0 uses: docker/setup-qemu-action@v2.1.0
@ -143,7 +138,7 @@ jobs:
platforms: linux/amd64,linux/arm64,linux/arm/v7 platforms: linux/amd64,linux/arm64,linux/arm/v7
cache-from: type=local,src=/tmp/.buildx-cache cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new cache-to: type=local,dest=/tmp/.buildx-cache-new
push: true push: false
tags: | 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_TAG }}
nocodb/${{ steps.get-docker-repository.outputs.DOCKER_REPOSITORY }}:${{ steps.get-docker-repository.outputs.DOCKER_BUILD_LATEST_TAG }} nocodb/${{ steps.get-docker-repository.outputs.DOCKER_REPOSITORY }}:${{ steps.get-docker-repository.outputs.DOCKER_BUILD_LATEST_TAG }}

57
packages/nocodb/webpack.timely.config.js

@ -0,0 +1,57 @@
const path = require('path');
const nodeExternals = require('webpack-node-externals');
const webpack = require('webpack');
const CopyPlugin = require('copy-webpack-plugin');
const TerserPlugin = require('terser-webpack-plugin');
const { resolveTsAliases } = require('./build-utils/resolveTsAliases');
module.exports = {
entry: './src/run/cloud.ts',
module: {
rules: [
{
test: /\.tsx?$/,
exclude: /node_modules/,
use: {
loader: 'ts-loader',
options: {
transpileOnly: true,
},
},
},
],
},
optimization: {
minimize: true, //Update this to true or false
minimizer: [new TerserPlugin()],
nodeEnv: false,
},
externals: [
nodeExternals({
allowlist: ['nocodb-sdk'],
}),
],
resolve: {
extensions: ['.tsx', '.ts', '.js', '.json'],
alias: resolveTsAliases(path.resolve('./src/ee-cloud/tsconfig.json')),
},
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 webpack.EnvironmentPlugin(['EE']),
new CopyPlugin({
patterns: [{ from: 'src/public', to: 'public' }],
}),
],
target: 'node',
};
Loading…
Cancel
Save