Skip to content
This repository has been archived by the owner on Oct 17, 2024. It is now read-only.

add a publish script; prep to publish 1.1.0 #104

Merged
merged 4 commits into from
Jan 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -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
5 changes: 2 additions & 3 deletions .github/workflows/test-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
strategy:
fail-fast: false
matrix:
sdk: [dev, beta]
sdk: [2.19.0, dev]
steps:
- uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
- uses: dart-lang/setup-dart@6a218f2413a3e78e9087f638a238f6b40893203d
Expand All @@ -47,8 +47,7 @@ jobs:
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
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## 1.1.0-dev
## 1.1.0

* Add `tryParseRadix`, `tryParseInt` and `tryParseHex` static methods
to both `Int32` and `Int64`.
Expand All @@ -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

Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,8 @@ A fixed-width 32- and 64- bit integer library for Dart.
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.
8 changes: 4 additions & 4 deletions lib/src/utilities.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ int validateRadix(int radix) =>
/// 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
Expand Down
6 changes: 3 additions & 3 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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
8 changes: 4 additions & 4 deletions test/int64_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -714,16 +714,16 @@ void main() {
});

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));
});

Expand Down