Skip to content

Commit

Permalink
fix(build): fix packaging (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
allardy authored Jun 2, 2021
1 parent 971f201 commit 994ad1f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@botpress/studio",
"version": "0.0.10",
"version": "0.0.11",
"description": "Create your virtual assistants",
"main": "index.js",
"bin": "./packages/studio-be/out/index.js",
Expand Down
12 changes: 7 additions & 5 deletions scripts/gulp.studio.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
const gulp = require('gulp')
const exec = require('child_process').exec
const rimraf = require('gulp-rimraf')
const { symlink } = require('gulp')
const path = require('path')
const promisify = require('util').promisify
const execAsync = promisify(exec)
Expand Down Expand Up @@ -67,12 +66,15 @@ const buildNativeExtensions = async () => {
}

const package = async () => {
const version = require(path.join(__dirname, '../package.json')).version.replace(/\./g, '_')

try {
await execAsync(
`cross-env ./node_modules/.bin/pkg --targets node12-win32-x64,node12-linux-x64,node12-macos-x64 --output ./binaries/studio --compress GZip ./package.json`
)
const cmd = `cross-env pkg --targets node12-win32-x64,node12-linux-x64,node12-macos-x64 --output ./binaries/studio ./package.json`

// Executing twice because for an unknown reason, the first time native extensions are not included
await execAsync(cmd)
await execAsync(cmd)

const version = require(path.join(__dirname, '../package.json')).version.replace(/\./g, '_')
await fse.rename('./binaries/studio-win.exe', `./binaries/studio-v${version}-win-x64.exe`)
await fse.rename('./binaries/studio-linux', `./binaries/studio-v${version}-linux-x64`)
await fse.rename('./binaries/studio-macos', `./binaries/studio-v${version}-darwin-x64`)
Expand Down

0 comments on commit 994ad1f

Please sign in to comment.