add a publish script; prep to publish 1.1.0 (#104)
* blast_repo fixes
auto-publish
* rev to 1.1.0
* update the sdk to a stable release
* update the sdks we test against
diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml
new file mode 100644
index 0000000..fcb7ccb
--- /dev/null
+++ b/.github/workflows/publish.yaml
@@ -0,0 +1,14 @@
+# A CI configuration to auto-publish pub packages.
+
+name: Publish
+
+on:
+ pull_request:
+ branches: [ master ]
+ push:
+ tags: [ 'v[0-9]+.[0-9]+.[0-9]+*' ]
+
+jobs:
+ publish:
+ if: ${{ github.repository_owner == 'dart-lang' }}
+ uses: dart-lang/ecosystem/.github/workflows/publish.yaml@main
diff --git a/.github/workflows/test-package.yml b/.github/workflows/test-package.yml
index 559b14f..26fffe2 100644
--- a/.github/workflows/test-package.yml
+++ b/.github/workflows/test-package.yml
@@ -20,7 +20,7 @@
strategy:
fail-fast: false
matrix:
- sdk: [dev, beta]
+ sdk: [2.19.0, dev]
steps:
- uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
- uses: dart-lang/setup-dart@6a218f2413a3e78e9087f638a238f6b40893203d
@@ -47,8 +47,7 @@
matrix:
# Add macos-latest and/or windows-latest if relevant for this package.
os: [ubuntu-latest]
- # TODO(devoncarew): Add `2.19.0` to this once that release is stable
- sdk: [dev, beta]
+ sdk: [2.19.0, dev]
steps:
- uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
- uses: dart-lang/setup-dart@6a218f2413a3e78e9087f638a238f6b40893203d
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a7fcd12..f731296 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,4 +1,4 @@
-## 1.1.0-dev
+## 1.1.0
* Add `tryParseRadix`, `tryParseInt` and `tryParseHex` static methods
to both `Int32` and `Int64`.
@@ -7,6 +7,7 @@
* Make `Int32` parse functions consistent with documentation (accept
leading minus sign, do not accept empty inputs).
* Update the minimum SDK constraint to 2.19.
+* Update to package:lints 2.0.0.
## 1.0.1
diff --git a/README.md b/README.md
index 33bdcc0..332d900 100644
--- a/README.md
+++ b/README.md
@@ -7,3 +7,8 @@
Provides data types for signed 32- and 64-bit integers.
The integer implementations in this library are designed to work identically
whether executed on the Dart VM or compiled to JavaScript.
+
+## Publishing automation
+
+For information about our publishing automation and release process, see
+https://github.com/dart-lang/ecosystem/wiki/Publishing-automation.
diff --git a/lib/src/utilities.dart b/lib/src/utilities.dart
index 45207d7..d603b57 100644
--- a/lib/src/utilities.dart
+++ b/lib/src/utilities.dart
@@ -16,12 +16,12 @@
/// not a valid digit in any radix in the range 2 through 36.
int decodeDigit(int c) {
// Hex digit char codes
- const int _c0 = 48; // '0'.codeUnitAt(0)
- const int _ca = 97; // 'a'.codeUnitAt(0)
+ const int c0 = 48; // '0'.codeUnitAt(0)
+ const int ca = 97; // 'a'.codeUnitAt(0)
- int digit = c ^ _c0;
+ int digit = c ^ c0;
if (digit < 10) return digit;
- int letter = (c | 0x20) - _ca;
+ int letter = (c | 0x20) - ca;
if (letter >= 0) {
// Returns values above 36 for invalid digits.
// The value is checked against the actual radix where the return
diff --git a/pubspec.yaml b/pubspec.yaml
index a380bb4..3180c25 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -1,13 +1,13 @@
name: fixnum
-version: 1.1.0-dev
+version: 1.1.0
description: >-
Library for 32- and 64-bit signed fixed-width integers with consistent
behavior between native and JS runtimes.
repository: https://github.com/dart-lang/fixnum
environment:
- sdk: '>=2.19.0-0 <3.0.0'
+ sdk: '>=2.19.0 <3.0.0'
dev_dependencies:
- lints: ^1.0.0
+ lints: ^2.0.0
test: ^1.16.0
diff --git a/test/int64_test.dart b/test/int64_test.dart
index 61fb6cf..bb5ac7a 100644
--- a/test/int64_test.dart
+++ b/test/int64_test.dart
@@ -714,16 +714,16 @@
});
test('JavaScript 53-bit integer boundary', () {
- Int64 _factorial(Int64 n) {
+ Int64 factorial(Int64 n) {
if (n.isZero) {
return Int64(1);
} else {
- return n * _factorial(n - Int64(1));
+ return n * factorial(n - Int64(1));
}
}
- Int64 fact18 = _factorial(Int64(18));
- Int64 fact17 = _factorial(Int64(17));
+ Int64 fact18 = factorial(Int64(18));
+ Int64 fact17 = factorial(Int64(17));
expect(fact18 ~/ fact17, Int64(18));
});