diff --git a/.github/workflows/release-npm.yml b/.github/workflows/release-npm.yml new file mode 100644 index 0000000000..e624c8afe3 --- /dev/null +++ b/.github/workflows/release-npm.yml @@ -0,0 +1,54 @@ +name: "Release : NPM packages" + +on: + workflow_dispatch: + inputs: + version: + description: "NocoDB package tag" + required: true + +jobs: + release: + runs-on: ubuntu-latest + env: + working-directory: ./packages/nocodb + strategy: + matrix: + node-version: [12] + steps: + - uses: actions/checkout@v2 + # Setup .npmrc file to publish to npm + - uses: actions/setup-node@v2 + with: + node-version: '12.x' + registry-url: 'https://registry.npmjs.org' + - run: | + cd packages/nc-gui + npm install + npm run build:copy:jsdeliver + cd ../.. + npm install + VERSION=${{github.event.inputs.version}} node scripts/upgradeNcGui.js node scripts/upgradeNcGui.js && cd packages/nocodb && npm run obfuscate:build:publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + - name: Create Pull Request + uses: peter-evans/create-pull-request@v3 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: +# commit-message: Update report +# committer: GitHub +# author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com> + signoff: true + branch: release-patches + delete-branch: true + title: 'Release ${{github.event.inputs.tag}}' + labels: | + release + automated pr + + - name: Check outputs + run: | + echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}" + echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}" + diff --git a/packages/nocodb/package-lock.json b/packages/nocodb/package-lock.json index 5345c97a1f..e5270a5ffd 100644 --- a/packages/nocodb/package-lock.json +++ b/packages/nocodb/package-lock.json @@ -1,6 +1,6 @@ { "name": "nocodb", - "version": "0.11.35", + "version": "0.11.36", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/packages/nocodb/package.json b/packages/nocodb/package.json index 04a389b284..0d0462ed4b 100644 --- a/packages/nocodb/package.json +++ b/packages/nocodb/package.json @@ -147,7 +147,7 @@ "nanoid": "^3.1.20", "nc-common": "0.0.6", "nc-help": "^0.2.14", - "nc-lib-gui": "^0.2.55", + "nc-lib-gui": "0.2.55", "nc-plugin": "^0.1.1", "ncp": "^2.0.0", "nodemailer": "^6.4.10", diff --git a/scripts/upgradeNcGui.js b/scripts/upgradeNcGui.js new file mode 100644 index 0000000000..8b31837155 --- /dev/null +++ b/scripts/upgradeNcGui.js @@ -0,0 +1,15 @@ +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'))) + +// upgrade nc-lib-gui version in nocodb +execSync(`cd packages/nocodb && npm install --save --save-exact nc-lib-gui@${ncLibPackage.version}`, {}); + +const nocodbPackageFilePath = path.join(__dirname, '..', 'packages', 'nocodb', 'package.json') +const nocoLibPackage = JSON.parse(fs.readFileSync(nocodbPackageFilePath)) +nocoLibPackage.version = process.env.VERSION; +fs.writeFileSync(nocodbPackageFilePath, JSON.stringify(nocoLibPackage, null, 2));