File tree Expand file tree Collapse file tree 3 files changed +37
-2
lines changed Expand file tree Collapse file tree 3 files changed +37
-2
lines changed Original file line number Diff line number Diff line change @@ -73,10 +73,15 @@ script: tool/travis/test.sh
7373
7474jobs :
7575 include :
76- # Deploy to GitHub .
77- - stage : deploy 1
76+ # Sanity check before releasing anywhere .
77+ - stage : sanity check
7878 if : &deploy-if
7979 (type IN (push, api)) AND (repo = sass/dart-sass) AND tag =~ ^\d+\.\d+\.\d+([+-].*)?$
80+ script : pub run grinder sanity-check-before-release
81+
82+ # Deploy to GitHub.
83+ - stage : deploy 1
84+ if : *deploy-if
8085 env : &github-env
8186 - GITHUB_USER=sassbot
8287 # GITHUB_AUTH="..."
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ export 'grind/chocolatey.dart';
1313export 'grind/github.dart' ;
1414export 'grind/homebrew.dart' ;
1515export 'grind/npm.dart' ;
16+ export 'grind/sanity_check.dart' ;
1617export 'grind/standalone.dart' ;
1718export 'grind/synchronize.dart' ;
1819
Original file line number Diff line number Diff line change 1+ // Copyright 2019 Google Inc. Use of this source code is governed by an
2+ // MIT-style license that can be found in the LICENSE file or at
3+ // https://opensource.org/licenses/MIT.
4+
5+ import 'dart:io' ;
6+
7+ import 'package:collection/collection.dart' ;
8+ import 'package:grinder/grinder.dart' ;
9+ import 'package:pub_semver/pub_semver.dart' ;
10+
11+ import 'utils.dart' ;
12+
13+ @Task ('Verify that the package is in a good state to release.' )
14+ sanityCheckBeforeRelease () {
15+ var travisTag = environment ("TRAVIS_TAG" );
16+ if (travisTag != version) {
17+ fail ("TRAVIS_TAG $travisTag is different than pubspec version $version ." );
18+ }
19+
20+ if (const ListEquality ().equals (Version .parse (version).preRelease, ["dev" ])) {
21+ fail ("$version is a dev release." );
22+ }
23+
24+ var versionHeader =
25+ RegExp ("^## ${RegExp .escape (version )}\$ " , multiLine: true );
26+ if (! File ("CHANGELOG.md" ).readAsStringSync ().contains (versionHeader)) {
27+ fail ("There's no CHANGELOG entry for $version ." );
28+ }
29+ }
You can’t perform that action at this time.
0 commit comments