diff --git a/.travis.yml b/.travis.yml index 37b8a1f..2dd023a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,7 +9,7 @@ cache: - node_modules script: - - bash scripts/travis-create-assets.sh + - node scripts/travis-create-assets.js - yarn lerna:format - yarn build @@ -25,7 +25,8 @@ deploy: api_key: $GITHUB_TOKEN skip_cleanup: true overwrite: true - file: "temp/packages/*" + file_glob: true + file: "temp/*" on: tags: true repo: neutronjs/neutron diff --git a/lerna.json b/lerna.json index 211be6a..26d77ee 100644 --- a/lerna.json +++ b/lerna.json @@ -7,7 +7,7 @@ "website" ], "useWorkspaces": true, - "version": "4.0.0-next.2", + "version": "4.0.0-next.3", "changelog": { "repo": "neutronjs/neutron", "labels": { diff --git a/package.json b/package.json index def403f..5963f36 100644 --- a/package.json +++ b/package.json @@ -30,6 +30,9 @@ "commit-msg": "commitlint -E HUSKY_GIT_PARAMS" } }, + "dependencies": { + "tar-pack": "^3.4.1" + }, "devDependencies": { "@commitlint/cli": "^8.3.5", "@commitlint/config-conventional": "^8.3.4", diff --git a/packages/neutron-cli/package.json b/packages/neutron-cli/package.json index ffe127a..4f309e7 100644 --- a/packages/neutron-cli/package.json +++ b/packages/neutron-cli/package.json @@ -1,7 +1,7 @@ { "name": "@neutronjs/cli", "description": "This CLI was developed to help developers create new projects quickly and easily", - "version": "4.0.0-next.2", + "version": "4.0.0-next.3", "license": "MIT", "main": "build/cli.js", "bin": { diff --git a/packages/neutron-start-react-native-template/package.json b/packages/neutron-start-react-native-template/package.json index 46f25c5..028da47 100644 --- a/packages/neutron-start-react-native-template/package.json +++ b/packages/neutron-start-react-native-template/package.json @@ -1,6 +1,6 @@ { "name": "@neutronjs/start-react-native-template", - "version": "4.0.0-next.2", + "version": "4.0.0-next.3", "main": "node_modules/expo/AppEntry.js", "scripts": { "start": "expo start", diff --git a/packages/neutron-start-react-template/package.json b/packages/neutron-start-react-template/package.json index 49ffb49..65cb9f9 100644 --- a/packages/neutron-start-react-template/package.json +++ b/packages/neutron-start-react-template/package.json @@ -1,6 +1,6 @@ { "name": "@neutronjs/start-react-template", - "version": "4.0.0-next.2", + "version": "4.0.0-next.3", "license": "MIT", "scripts": { "start": "craco start", diff --git a/scripts/travis-create-assets.js b/scripts/travis-create-assets.js new file mode 100644 index 0000000..ff37a9b --- /dev/null +++ b/scripts/travis-create-assets.js @@ -0,0 +1,28 @@ +/** + * NEUTRON JS - RELEASE ASSETS COMPRESS + */ +const fs = require('fs'); +const tarPack = require('tar-pack'); + +const dirs = { + PACKAGES: `${process.cwd()}/packages`, + TEMP: `${process.cwd()}/temp`, +}; + +const packages = fs.readdirSync(dirs.PACKAGES); + +if (fs.existsSync(dirs.TEMP)) { + console.log('Removing temp dir.') + fs.rmdirSync(dirs.TEMP, { recursive: true }); +} + +console.log('Creating temp dir.') +fs.mkdirSync(dirs.TEMP) + +console.log('Compressing packages: tar.gz') +packages.forEach(package => { + tarPack.pack(`${dirs.PACKAGES}/${package}/`) + .pipe(fs.createWriteStream(`${dirs.TEMP}/${package}.tar.gz`)) +}); + +console.log('Done!') diff --git a/scripts/travis-create-assets.sh b/scripts/travis-create-assets.sh deleted file mode 100644 index 0570d9d..0000000 --- a/scripts/travis-create-assets.sh +++ /dev/null @@ -1,16 +0,0 @@ -########################################## -## NEUTRON JS - RELEASE ASSETS COMPRESS ## -########################################## - -# REMOVE TEMP DIR IF EXISTS -if [ -d temp ]; then - rm -rf temp -fi - -# CREATE OUTPUT DIR -mkdir -p temp/packages - -# COMPRESS PACKAGES -for package in packages/*; do - tar -czvf temp/$package.tar.gz $package -done diff --git a/website/package.json b/website/package.json index d36e2ec..03cb7e8 100644 --- a/website/package.json +++ b/website/package.json @@ -1,6 +1,6 @@ { "name": "@neutronjs/website", - "version": "4.0.0-next.2", + "version": "4.0.0-next.3", "private": true, "scripts": { "docusaurus": "docusaurus",