diff --git a/.github/workflows/review.yaml b/.github/workflows/review.yaml index 37c9a50..9fe8752 100644 --- a/.github/workflows/review.yaml +++ b/.github/workflows/review.yaml @@ -1,4 +1,4 @@ -name: review +name: review.sh on: push: {branches: ["main", "dev"]} @@ -10,4 +10,4 @@ jobs: steps: - uses: actions/checkout@v4 - uses: dart-lang/setup-dart@v1 - - run: sh review.sh + - run: sh ci/review.sh diff --git a/CHANGELOG.md b/CHANGELOG.md index dbf75e7..df51369 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.1.1 + +- Optimize ci sh. + ## 0.1.0 - Establish basic repo including manifest, testings, and ci. diff --git a/ci/gen.sh b/ci/gen.sh new file mode 100644 index 0000000..b59de49 --- /dev/null +++ b/ci/gen.sh @@ -0,0 +1,3 @@ +cd example +sh ci/gen.sh +cd .. diff --git a/ci/review.sh b/ci/review.sh new file mode 100644 index 0000000..5435e22 --- /dev/null +++ b/ci/review.sh @@ -0,0 +1,6 @@ +dart pub get || exit 1 +dart format --output=none --set-exit-if-changed . || exit 1 +dart analyze --fatal-infos || exit 1 +sh ci/gen.sh || exit 1 +dart test test/*.dart || exit 1 +dart pub publish --dry-run || exit 1 diff --git a/example/.gitignore b/example/.gitignore new file mode 100644 index 0000000..542b221 --- /dev/null +++ b/example/.gitignore @@ -0,0 +1,2 @@ +# Ignore generated file managed by program. +lib/manifest.dart diff --git a/example/ci/gen.sh b/example/ci/gen.sh new file mode 100644 index 0000000..c268f74 --- /dev/null +++ b/example/ci/gen.sh @@ -0,0 +1,3 @@ +output="lib/manifest.dart" +dart run manifest --output $output || exit 1 +dart format --output=none --set-exit-if-changed $output || exit 1 diff --git a/example/lib/manifest.dart b/example/lib/manifest.dart deleted file mode 100644 index ac3b9e5..0000000 --- a/example/lib/manifest.dart +++ /dev/null @@ -1,7 +0,0 @@ -import 'package:manifest/manifest.dart'; - -const manifest = Manifest( - name: 'manifest_example', - version: '1.2.3-pre-4.5', - description: 'An example and the tester for the manifest package.', -); diff --git a/example/test/example_test.dart b/example/test/example_test.dart index 1350741..5a3fbac 100644 --- a/example/test/example_test.dart +++ b/example/test/example_test.dart @@ -2,7 +2,8 @@ import 'package:manifest_example/example.dart'; import 'package:test/test.dart'; void main() { - test('manifest gen', () { + // Such test must run after generating the manifest file. + test('manifest gen.sh.sh', () { expect(manifest.name, 'manifest_example'); expect(manifest.version, '1.2.3-pre-4.5'); expect( diff --git a/pubspec.yaml b/pubspec.yaml index c70bbaa..dfd368a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: manifest description: >- A command line tool to generate Dart package manifest from pubspec.yaml. -version: 0.1.0 +version: 0.1.1 homepage: https://github.com/treeinfra/manifest environment: {sdk: ^3.4.3} topics: diff --git a/review.sh b/review.sh deleted file mode 100644 index 5d1ec70..0000000 --- a/review.sh +++ /dev/null @@ -1,16 +0,0 @@ -echo_pos() { echo && echo "\033[32m"$1"\033[0m" && echo; } - -echo_pos "[root repo]" -dart pub get || exit 1 -dart format --output=none --set-exit-if-changed . || exit 1 -dart analyze --fatal-infos || exit 1 -dart test test/*.dart || exit 1 - -cd example && echo_pos "[example child repo]" || exit 1 -output="lib/manifest.dart" -dart run manifest --output $output || exit 1 -dart format --output=none --set-exit-if-changed $output || exit 1 -dart test || exit 1 - -cd .. && echo_pos "[back to root repo]" -dart pub publish --dry-run || exit 1