dart-sass/tool/grind/sanity_check.dart

31 lines
926 B
Dart
Raw Normal View History

// Copyright 2019 Google Inc. Use of this source code is governed by an
// MIT-style license that can be found in the LICENSE file or at
// https://opensource.org/licenses/MIT.
import 'dart:io';
import 'package:grinder/grinder.dart';
import 'package:pub_semver/pub_semver.dart';
2019-05-31 16:45:27 +02:00
import 'package:sass/src/utils.dart';
import 'utils.dart';
@Task('Verify that the package is in a good state to release.')
sanityCheckBeforeRelease() {
var travisTag = environment("TRAVIS_TAG");
if (travisTag != version) {
fail("TRAVIS_TAG $travisTag is different than pubspec version $version.");
}
2019-05-31 16:45:27 +02:00
if (listEquals(Version.parse(version).preRelease, ["dev"])) {
fail("$version is a dev release.");
}
var versionHeader =
RegExp("^## ${RegExp.escape(version)}\$", multiLine: true);
if (!File("CHANGELOG.md").readAsStringSync().contains(versionHeader)) {
fail("There's no CHANGELOG entry for $version.");
}
}