Skip to content

Commit

Permalink
🚧 Let's add nightly builds to ct.js
Browse files Browse the repository at this point in the history
  • Loading branch information
CosmoMyzrailGorynych committed Aug 12, 2020
1 parent b1a5a9c commit a894d8b
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 5 deletions.
21 changes: 18 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@ stages:
- name: lint
- name: build
- name: pack
if: tag IS present
- name: deploy
if: tag IS present
if: (tag IS present) AND (type != cron)
- name: packNightly
if: (branch = develop) AND (type = cron)

jobs:
include:

- stage: lint
script:
- gulp lint
Expand All @@ -28,6 +29,7 @@ jobs:
script:
- gulp build
skip_cleanup: true

- stage: pack
script:
- gulp -f devSetup.gulpfile.js
Expand All @@ -48,5 +50,18 @@ jobs:
- provider: script
script: gulp deployOnly
skip_cleanup: true
on:
all_branches: true

- stage: packNightly
script:
- gulp -f devSetup.gulpfile.js
- gulp packages --nightly --buildNum=$TRAVIS_BUILD_NUMBER
skip_cleanup: true
deploy:
# Push to comigo.itch.io/ct
- provider: script
script: gulp deployOnly --nightly --buildNum=$TRAVIS_BUILD_NUMBER
skip_cleanup: true
on:
all_branches: true
Binary file added buildAssets/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added buildAssets/nightly.icns
Binary file not shown.
Binary file added buildAssets/nightly.ico
Binary file not shown.
Binary file added buildAssets/nightly.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 21 additions & 2 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,13 @@ const npm = (/^win/).test(process.platform) ? 'npm.cmd' : 'npm';
const pack = require('./app/package.json');

var channelPostfix = argv.channel || false,
fixEnabled = argv.fix || false;
fixEnabled = argv.fix || false,
nightly = argv.nightly || false,
buildNumber = argv.buildNum || false;

if (nightly) {
channelPostfix = 'nightly';
}

let errorBoxShown = false;
const showErrorBox = function () {
Expand Down Expand Up @@ -390,6 +396,12 @@ const build = gulp.parallel([

const bakePackages = async () => {
const NwBuilder = require('nw-builder');
// Use the appropriate icon for each release channel
if (nightly) {
await fs.copy('./buildAssets/icon.png', './app/ct_ide.png');
} else {
await fs.copy('./buildAssets/nightly.png', './app/ct_ide.png');
}
await fs.remove(path.join('./build', `ctjs - v${pack.version}`));
var nw = new NwBuilder({
files: nwFiles,
Expand All @@ -399,7 +411,7 @@ const bakePackages = async () => {
buildType: 'versioned',
// forceDownload: true,
zip: false,
macIcns: './buildAssets/icon.icns'
macIcns: nightly ? './buildAssets/nightly.icns' : './buildAssets/icon.icns'
});
await nw.build();
console.log('Built to this location:', path.join('./build', `ctjs - v${pack.version}`));
Expand Down Expand Up @@ -527,6 +539,13 @@ const packages = gulp.series([

const deployOnly = () => {
console.log(`For channel ${channelPostfix}`);
if (nightly) {
return spawnise.spawn('./butler', ['push', `./build/ctjs - v${pack.version}/linux32`, `comigo/ct:linux32${channelPostfix ? '-' + channelPostfix : ''}`, '--userversion', buildNumber])
.then(() => spawnise.spawn('./butler', ['push', `./build/ctjs - v${pack.version}/linux64`, `comigo/ct:linux64${channelPostfix ? '-' + channelPostfix : ''}`, '--userversion', buildNumber]))
.then(() => spawnise.spawn('./butler', ['push', `./build/ctjs - v${pack.version}/osx64`, `comigo/ct:osx64${channelPostfix ? '-' + channelPostfix : ''}`, '--userversion', buildNumber]))
.then(() => spawnise.spawn('./butler', ['push', `./build/ctjs - v${pack.version}/win32`, `comigo/ct:win32${channelPostfix ? '-' + channelPostfix : ''}`, '--userversion', buildNumber]))
.then(() => spawnise.spawn('./butler', ['push', `./build/ctjs - v${pack.version}/win64`, `comigo/ct:win64${channelPostfix ? '-' + channelPostfix : ''}`, '--userversion', buildNumber]));
}
return spawnise.spawn('./butler', ['push', `./build/ctjs - v${pack.version}/linux32`, `comigo/ct:linux32${channelPostfix ? '-' + channelPostfix : ''}`, '--userversion', pack.version])
.then(() => spawnise.spawn('./butler', ['push', `./build/ctjs - v${pack.version}/linux64`, `comigo/ct:linux64${channelPostfix ? '-' + channelPostfix : ''}`, '--userversion', pack.version]))
.then(() => spawnise.spawn('./butler', ['push', `./build/ctjs - v${pack.version}/osx64`, `comigo/ct:osx64${channelPostfix ? '-' + channelPostfix : ''}`, '--userversion', pack.version]))
Expand Down

0 comments on commit a894d8b

Please sign in to comment.