Skip to content
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
4 changes: 1 addition & 3 deletions .github/workflows/dart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ name: Dart
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:
Expand All @@ -13,7 +11,7 @@ jobs:
image: dart:stable

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Print Dart SDK version
run: dart --version
Expand Down
69 changes: 69 additions & 0 deletions .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: PR checks

on:
pull_request:
branches: [ master ]

jobs:
check:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Dart
uses: dart-lang/setup-dart@v1
with:
sdk: stable
cache: pub

- name: Fetch base ref
run: git fetch origin ${{ github.base_ref }}

- name: Check version bumped
run: |
BASE_VERSION=$(git show origin/${{ github.base_ref }}:pubspec.yaml 2>/dev/null | sed -n 's/^version: *//p' | tr -d ' \r' || echo "0.0.0")
CURRENT_VERSION=$(sed -n 's/^version: *//p' pubspec.yaml | tr -d ' \r')

if [ -z "$CURRENT_VERSION" ]; then
echo "::error::Could not read version from pubspec.yaml"
exit 1
fi

if [ "$(printf '%s\n%s' "$BASE_VERSION" "$CURRENT_VERSION" | sort -V | head -1)" = "$CURRENT_VERSION" ] && [ "$BASE_VERSION" != "$CURRENT_VERSION" ]; then
echo "::error::Version $CURRENT_VERSION is not greater than base version $BASE_VERSION. Bump the version in pubspec.yaml."
exit 1
fi

if [ "$BASE_VERSION" = "$CURRENT_VERSION" ]; then
echo "::error::Version was not bumped. Base is $BASE_VERSION, current is $CURRENT_VERSION. Bump the version in pubspec.yaml."
exit 1
fi

echo "Version bumped: $BASE_VERSION -> $CURRENT_VERSION"

- name: Check changelog updated
run: |
CURRENT_VERSION=$(sed -n 's/^version: *//p' pubspec.yaml | tr -d ' \r')

if ! grep -qF "## [$CURRENT_VERSION]" CHANGELOG.md; then
echo "::error::CHANGELOG.md has no entry for version $CURRENT_VERSION. Add a section '## [$CURRENT_VERSION]' with your changes."
exit 1
fi

echo "CHANGELOG has entry for $CURRENT_VERSION"

- name: Install dependencies
run: dart pub get

- name: Static analysis
run: dart analyze

- name: Run tests
run: dart test

- name: Publish dry-run
run: dart pub publish --dry-run
13 changes: 13 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# https://dart.dev/tools/pub/automated-publishing
name: Publish to pub.dev

on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'

jobs:
publish:
permissions:
id-token: write
uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1
11 changes: 11 additions & 0 deletions .pubignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.github/
AGENTS.md
CLAUDE.md
CODE_OF_CONDUCT.md
CONTRIBUTING.md
SECURITY.md
SUPPORT.md
codecov.yml
codemagic.yaml
coverage/
coverage_badge.svg
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
## [1.2.2] - 2026

### Bug Fixes
* Fixed `capitalize()` to normalize already-capitalized and all-uppercase inputs like `HELLO` and `HeLLo` to `Hello`
* Preserved acronym tokens in `camelCase()` while fixing `capitalize()` behavior

### Tests
* Added regression coverage for uppercase and mixed-case `capitalize()` inputs

## [1.2.1] - 2025

### Documentation
Expand Down Expand Up @@ -60,4 +69,3 @@
## [0.0.2-prerelease] - 04/01/2021

* Trying to get full pub score

Loading