This repository has been archived by the owner on Mar 3, 2021. It is now read-only.
forked from jquery/jquery-release
-
Notifications
You must be signed in to change notification settings - Fork 1
/
release.js
88 lines (66 loc) · 1.68 KB
/
release.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
var bootstrap = require( "./lib/bootstrap.js" ),
cdn = require( "./lib/cdn.js" ),
npm = require( "./lib/npm.js" ),
prompt = require( "./lib/prompt.js" ),
repo = require( "./lib/repo.js" ),
util = require( "./lib/util.js" ),
// State and config object
Release = {
// set by bootstrap.parseArguments
args: null,
branch: null,
preRelease: false,
remote: null,
isTest: true,
// set by bootstrap.createReleaseDirectory
dir: null,
// set by repo.getVersions
newVersion: null,
nextVersion: null
},
commonTasks, stableTasks;
function complete() {
console.log( "Release complete." );
console.log( "Please review the project-specific release checklist." );
}
global.Release = Release;
commonTasks = [
bootstrap.checkExecutables,
bootstrap.parseArguments,
prompt.confirm,
bootstrap.createReleaseDirectory,
util.section( "setting up repo" ),
repo.cloneRepo,
repo.checkAuthorsTxt,
npm.checkNpmCredentials,
util.section( "calculating versions" ),
repo.getVersions,
prompt.confirm,
util.section( "building release" ),
repo.createReleaseBranch,
util.section( "pushing tag" ),
prompt.confirmReview,
repo.pushRelease,
util.section( "publishing to jQuery CDN" ),
cdn.copyCdnArtifacts,
prompt.confirmReview,
cdn.pushToCdn,
util.section( "publishing to npm" ),
npm.publishNpm
];
stableTasks = [
util.section( "updating branch version" ),
repo.updateBranchVersion,
function() {
// use closure to capture live state of 'Release.branch'
util.section( "pushing " + Release.branch )();
},
prompt.confirmReview,
repo.pushBranch
];
util.walk( commonTasks, function() {
if ( Release.preRelease ) {
return complete();
}
util.walk( stableTasks, complete );
} );