generated from actions/typescript-action
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1. Skip release when version exists. 2. Use pub version
- Loading branch information
1 parent
8fc7938
commit 27dc073
Showing
8 changed files
with
128 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import 'dart:io'; | ||
|
||
import 'package:action_dio_release/action_dio_release.dart'; | ||
import 'package:github/github.dart'; | ||
import 'package:test/test.dart'; | ||
|
||
void main() { | ||
github = GitHub( | ||
auth: Authentication.withToken(Platform.environment['GITHUB_TOKEN']!), | ||
); | ||
|
||
test('releaseExists', () async { | ||
const owner = 'fluttercandies'; | ||
const repo = 'flutter_photo_manager'; | ||
expect( | ||
await releaseExists(owner: owner, repo: repo, releaseName: '2.6.0'), | ||
isTrue, | ||
); | ||
|
||
expect( | ||
await releaseExists(owner: owner, repo: repo, releaseName: '0.1.1'), | ||
isTrue, | ||
); | ||
|
||
expect( | ||
await releaseExists(owner: owner, repo: repo, releaseName: '0.0.0'), | ||
isFalse, | ||
); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import 'package:pub_semver/pub_semver.dart'; | ||
import 'package:test/expect.dart'; | ||
import 'package:test/scaffolding.dart'; | ||
|
||
void main() { | ||
const versionList = <String>[ | ||
'1.0.0', | ||
'2.0.0', | ||
'0.0.1-build', | ||
'0.0.2+1', | ||
'0.0.2-build.1', | ||
'0.0.2-dev.2', | ||
'0.0.2-nullsafety', | ||
]; | ||
|
||
const unvalidVersionList = <String>[ | ||
'1.0', | ||
'3', | ||
'1.0.3.0', | ||
'v3.0.0', | ||
]; | ||
|
||
group('Test support versions', () { | ||
for (final version in versionList) { | ||
test('Test version $version', () { | ||
final v = Version.parse(version); | ||
print(v); | ||
}); | ||
} | ||
}); | ||
|
||
group('Test unvalid versions', () { | ||
for (final version in unvalidVersionList) { | ||
test('Test version $version', () { | ||
expect(() => Version.parse(version), throwsA(isA<FormatException>())); | ||
}); | ||
} | ||
}); | ||
} |