Skip to content

Commit 299b587

Browse files
committed
Merge pull request #1405 from erwinmombay/latest-changelog
add canary suffix to folder names and fix target of tagging
2 parents 8f09310 + 9e45d49 commit 299b587

File tree

2 files changed

+7
-13
lines changed

2 files changed

+7
-13
lines changed

build-system/internal-version.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
* limitations under the License.
1515
*/
1616

17+
var argv = require('minimist')(process.argv.slice(2));
18+
var suffix = argv.type == 'canary' ? '-canary' : '';
19+
1720
// Used to e.g. references the ads binary from the runtime to get
1821
// version lock.
19-
exports.VERSION = new Date().getTime();
22+
exports.VERSION = new Date().getTime() + suffix;

build-system/tasks/changelog.js

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ var git = require('gulp-git');
3131
var gulp = require('gulp-help')(require('gulp'));
3232
var request = BBPromise.promisify(require('request'));
3333
var util = require('gulp-util');
34+
var version = require('../internal-version').VERSION;
3435

3536
var GITHUB_ACCESS_TOKEN = process.env.GITHUB_ACCESS_TOKEN;
3637
var exec = BBPromise.promisify(child_process.exec);
@@ -56,13 +57,6 @@ function changelog() {
5657
}
5758

5859
function getGitMetadata() {
59-
var version = argv.version;
60-
var versionErrMsg = 'No version option passed';
61-
62-
if (!version) {
63-
util.log(util.colors.red(versionErrMsg));
64-
throw new Error(versionErrMsg);
65-
}
6660

6761
var gitMetadata = {};
6862
return getLastGitTag()
@@ -82,9 +76,7 @@ function getGitMetadata() {
8276
}
8377

8478
function submitReleaseNotes(version, changelog) {
85-
assert(typeof version == 'number', 'version should be a number. ' + version);
86-
87-
var name = String(version) + suffix;
79+
var name = String(version);
8880
var options = {
8981
url: 'https://api.github.com/repos/ampproject/amphtml/releases',
9082
method: 'POST',
@@ -95,7 +87,7 @@ function submitReleaseNotes(version, changelog) {
9587
json: true,
9688
body: {
9789
'tag_name': name,
98-
'target_commitish': 'release',
90+
'target_commitish': branch,
9991
'name': name,
10092
'body': changelog,
10193
'draft': true,
@@ -260,6 +252,5 @@ gulp.task('changelog', 'Create github release draft', changelog, {
260252
options: {
261253
dryrun: ' Generate changelog but dont push it out',
262254
type: ' Pass in "canary" to generate a canary changelog',
263-
version: ' Label to be used for this tag release',
264255
}
265256
});

0 commit comments

Comments
 (0)