Skip to content

Commit

Permalink
Merge branch 'release/17.0.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
joanpablo committed May 10, 2024
2 parents 30ba6d1 + 07b787a commit 31e3018
Show file tree
Hide file tree
Showing 7 changed files with 82 additions and 8 deletions.
43 changes: 39 additions & 4 deletions .github/workflows/reactive_forms.yaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
name: reactive_forms

on:
# Trigger the workflow on push
# but only for the master branch
push:
branches:
- master
- develop
- "feature/**"
tags:
- '*'
pull_request:
branches:
- master
- develop

jobs:
test:
# Job name is Running Tests
name: Tests
# This job runs on Linux
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -58,3 +56,40 @@ jobs:
run: dart format lib --set-exit-if-changed
- name: Format test
run: dart format test --set-exit-if-changed

publish-warnings:
name: Publish warnings
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
with:
flutter-version: "3.16.0"
channel: "stable"
- run: flutter pub get
- name: Check publish warnings
run: dart pub publish --dry-run

deployment:
if: ${{ github.ref_type == 'tag' }}
needs: [test, analyze, format, publish-warnings]
name: Deploy package
runs-on: ubuntu-latest

steps:
- name: Configure enviroment
uses: actions/checkout@v3
- name: Download flutter
uses: subosito/flutter-action@v2
with:
flutter-version: "3.16.0"
channel: "stable"
- name: Setup pub credentials
shell: bash
env:
PUB_DEV_PUBLISH_ACCESS_TOKEN: ${{ secrets.PUB_DEV_PUBLISH_ACCESS_TOKEN }}
PUB_DEV_PUBLISH_REFRESH_TOKEN: ${{ secrets.PUB_DEV_PUBLISH_REFRESH_TOKEN }}
run: |
sh ./tool/pub_login.sh
- name: Publish package
run: dart pub publish -v -f
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# 17.0.1

- Reduce `intl` dependency constraint to match Flutter 3.16.0.
- NumberValidator allows null values.

# 17.0.0

## Breaking changes
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ dependencies:
flutter:
sdk: flutter

reactive_forms: ^17.0.0
reactive_forms: ^17.0.1
```
Then run the command `flutter packages get` on the console.
Expand Down
4 changes: 3 additions & 1 deletion example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ environment:
dependencies:
flutter:
sdk: flutter
intl: ^0.19.0
flutter_localizations:
sdk: flutter
intl: '>=0.18.1 <1.0.0'
reactive_forms:
path: ../
#reactive_forms_widgets: ^0.3.1
Expand Down
1 change: 1 addition & 0 deletions lib/src/validators/number_validator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class NumberValidator extends Validator<dynamic> {

/// Creates a new NumberValidator instance to validate strings representing numbers.
///
/// [allowNull] (optional): Whether the validator allows null values.
/// [allowedDecimals] (optional): The allowed number of decimal places. Defaults to 0.
/// [allowNegatives] (optional): Whether to allow negative numbers. Defaults to true.
const NumberValidator({
Expand Down
7 changes: 5 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: reactive_forms
description: This is a model-driven approach to handling form inputs and validations, heavily inspired in Angular Reactive Forms.
version: 17.0.0
version: 17.0.1
homepage: "https://github.com/joanpablo/reactive_forms"

environment:
Expand All @@ -10,7 +10,10 @@ environment:
dependencies:
flutter:
sdk: flutter
intl: ">=0.19.0 <1.0.0"
# Keep flutter_localizations to ensure correct intl constraints
flutter_localizations:
sdk: flutter
intl: ">=0.18.1 <1.0.0"

dev_dependencies:
flutter_lints: ^3.0.2
Expand Down
28 changes: 28 additions & 0 deletions tool/pub_login.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/sh

# This script creates/updates credentials.json file which is used
# to authorize publisher when publishing packages to pub.dev

# Checking whether the secrets are available as environment
# variables or not.
if [ -z "${PUB_DEV_PUBLISH_ACCESS_TOKEN}" ]; then
echo "Missing PUB_DEV_PUBLISH_ACCESS_TOKEN environment variable"
exit 1
fi

if [ -z "${PUB_DEV_PUBLISH_REFRESH_TOKEN}" ]; then
echo "Missing PUB_DEV_PUBLISH_REFRESH_TOKEN environment variable"
exit 1
fi

# Create credentials.json file.
mkdir -p ~/.config/dart
cat <<EOF > ~/.config/dart/pub-credentials.json
{
"accessToken": "${PUB_DEV_PUBLISH_ACCESS_TOKEN}",
"refreshToken": "${PUB_DEV_PUBLISH_REFRESH_TOKEN}",
"tokenEndpoint": "https://accounts.google.com/o/oauth2/token",
"scopes": ["https://www.googleapis.com/auth/userinfo.email","openid"],
"expiration": 1655303397262
}
EOF

0 comments on commit 31e3018

Please sign in to comment.