Browse Source

chore: update actions to deploy nestjs backend

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/5510/head
Pranav C 2 years ago
parent
commit
458ccbd705
  1. 3
      .github/workflows/release-docker.yml
  2. 2
      .github/workflows/release-npm.yml
  3. 1
      .github/workflows/release-pr.yml
  4. 7
      packages/nocodb-nest/package.json
  5. 14
      scripts/upgradeNcGui.js
  6. 6
      scripts/upgradeNocodbSdk.js

3
.github/workflows/release-docker.yml

@ -43,7 +43,7 @@ jobs:
buildx: buildx:
runs-on: ubuntu-latest runs-on: ubuntu-latest
env: env:
working-directory: ./packages/nocodb working-directory: ./packages/nocodb-nest
steps: steps:
- name: Get Docker Repository - name: Get Docker Repository
id: get-docker-repository id: get-docker-repository
@ -104,7 +104,6 @@ jobs:
- name: Build nocodb and docker files - name: Build nocodb and docker files
run: | run: |
npm run build
npm run docker:build npm run docker:build
working-directory: ${{ env.working-directory }} working-directory: ${{ env.working-directory }}

2
.github/workflows/release-npm.yml

@ -35,7 +35,7 @@ jobs:
release: release:
runs-on: ubuntu-latest runs-on: ubuntu-latest
env: env:
working-directory: ./packages/nocodb working-directory: ./packages/nocodb-nest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@v3

1
.github/workflows/release-pr.yml

@ -13,6 +13,7 @@ on:
- "packages/nc-gui/**" - "packages/nc-gui/**"
- "packages/nc-plugin/**" - "packages/nc-plugin/**"
- "packages/nocodb/**" - "packages/nocodb/**"
- "packages/nocodb-nest/**"
concurrency: concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}

7
packages/nocodb-nest/package.json

@ -1,7 +1,7 @@
{ {
"name": "nocodb-nest", "name": "nocodb",
"version": "0.0.1", "version": "0.106.1",
"description": "NocoDB Backend (Nest)", "description": "NocoDB Backend",
"main": "dist/bundle.js", "main": "dist/bundle.js",
"author": { "author": {
"name": "NocoDB Inc", "name": "NocoDB Inc",
@ -20,6 +20,7 @@
"scripts": { "scripts": {
"build": "nest build", "build": "nest build",
"build:obfuscate": "EE=true webpack --config webpack.config.js", "build:obfuscate": "EE=true webpack --config webpack.config.js",
"obfuscate:build:publish": "npm run build:obfuscate && npm publish .",
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"", "format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
"start": "nest start", "start": "nest start",
"start:dev": "nest start --watch", "start:dev": "nest start --watch",

14
scripts/upgradeNcGui.js

@ -22,8 +22,8 @@ const replacePackageName = (filePath) => {
const bumbVersionAndSave = () => { const bumbVersionAndSave = () => {
// upgrade nc-lib-gui version in nocodb // upgrade nc-lib-gui version in nocodb
execSync(`cd packages/nocodb && npm install --save --save-exact ${ncLibPackage.name}@${ncLibPackage.version}`, {}); execSync(`cd packages/nocodb-nest && npm install --save --save-exact ${ncLibPackage.name}@${ncLibPackage.version}`, {});
const nocodbPackageFilePath = path.join(__dirname, '..', 'packages', 'nocodb', 'package.json') const nocodbPackageFilePath = path.join(__dirname, '..', 'packages', 'nocodb-nest', 'package.json')
const nocoLibPackage = JSON.parse(fs.readFileSync(nocodbPackageFilePath)) const nocoLibPackage = JSON.parse(fs.readFileSync(nocodbPackageFilePath))
if (process.env.targetEnv === 'DEV') { if (process.env.targetEnv === 'DEV') {
nocoLibPackage.name = `${nocoLibPackage.name}-daily` nocoLibPackage.name = `${nocoLibPackage.name}-daily`
@ -35,11 +35,11 @@ const bumbVersionAndSave = () => {
if (process.env.targetEnv === 'DEV') { if (process.env.targetEnv === 'DEV') {
// replace nc-lib-gui by nc-lib-gui-daily if it is nightly build / pr release // replace nc-lib-gui by nc-lib-gui-daily if it is nightly build / pr release
const filePaths = [ const filePaths = [
path.join(__dirname, '..', 'packages', 'nocodb', 'Dockerfile'), path.join(__dirname, '..', 'packages', 'nocodb-nest', 'Dockerfile'),
path.join(__dirname, '..', 'packages', 'nocodb', 'litestream', 'Dockerfile'), path.join(__dirname, '..', 'packages', 'nocodb-nest', 'litestream', 'Dockerfile'),
path.join(__dirname, '..', 'packages', 'nocodb', 'package.json'), path.join(__dirname, '..', 'packages', 'nocodb-nest', 'package.json'),
path.join(__dirname, '..', 'packages', 'nocodb', 'README.md'), path.join(__dirname, '..', 'packages', 'nocodb-nest', 'README.md'),
path.join(__dirname, '..', 'packages', 'nocodb', 'src', 'lib', 'Noco.ts'), path.join(__dirname, '..', 'packages', 'nocodb-nest', 'src', 'lib', 'Noco.ts'),
] ]
Promise.all(filePaths.map(filePath => { return replacePackageName(filePath) })).then(() => { Promise.all(filePaths.map(filePath => { return replacePackageName(filePath) })).then(() => {
bumbVersionAndSave(); bumbVersionAndSave();

6
scripts/upgradeNocodbSdk.js

@ -20,7 +20,7 @@ const replacePackageName = (filePath) => {
const bumbVersionAndSave = () => { const bumbVersionAndSave = () => {
// upgrade nocodb-sdk version in nocodb // upgrade nocodb-sdk version in nocodb
execSync(`cd packages/nocodb && npm install --save --save-exact ${nocodbSdkPackage.name}@${nocodbSdkPackage.version}`, {}); execSync(`cd packages/nocodb-nest && npm install --save --save-exact ${nocodbSdkPackage.name}@${nocodbSdkPackage.version}`, {});
// upgrade nocodb-sdk version in nc-gui // upgrade nocodb-sdk version in nc-gui
execSync(`cd packages/nc-gui && npm install --save --save-exact ${nocodbSdkPackage.name}@${nocodbSdkPackage.version}`, {}); execSync(`cd packages/nc-gui && npm install --save --save-exact ${nocodbSdkPackage.name}@${nocodbSdkPackage.version}`, {});
} }
@ -47,9 +47,9 @@ const dfs = function(dir) {
const searchAndReplace = (target) => { const searchAndReplace = (target) => {
let list = [ let list = [
...dfs(path.resolve(path.join(__dirname, '..', 'packages', 'nc-gui'))), ...dfs(path.resolve(path.join(__dirname, '..', 'packages', 'nc-gui'))),
...dfs(path.resolve(path.join(__dirname, '..', 'packages', 'nocodb'))), ...dfs(path.resolve(path.join(__dirname, '..', 'packages', 'nocodb-nest'))),
path.join(__dirname, '..', 'packages', 'nc-gui', 'package.json'), path.join(__dirname, '..', 'packages', 'nc-gui', 'package.json'),
path.join(__dirname, '..', 'packages', 'nocodb', 'package.json') path.join(__dirname, '..', 'packages', 'nocodb-nest', 'package.json')
] ]
return Promise.all(list.map(d => { return Promise.all(list.map(d => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {

Loading…
Cancel
Save