Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
a64bfb7
docs: add release instructions
atreeon Aug 18, 2025
2a29b0a
chore: automate tests and releases
atreeon Aug 19, 2025
d43e476
Merge branch 'master' into codex/suggest-ci-workflow-for-release-folder
atreeon Aug 19, 2025
5128565
updated versions
atreeon Aug 19, 2025
6fa709f
don't run tests on push, only pull request
atreeon Aug 19, 2025
abd6a22
no need to dry publish the annotation
atreeon Aug 19, 2025
65a4790
possible errors in the dart.yml github action file
atreeon Aug 19, 2025
d24d230
sdk version not found
atreeon Aug 19, 2025
1defea7
sdk: "3.8.2"
atreeon Aug 19, 2025
72c4840
trying to setup using flutter instead
atreeon Aug 19, 2025
69bb41c
clutching at straws!
atreeon Aug 19, 2025
50114ad
clutching at straws x2!
atreeon Aug 19, 2025
46ac426
clutching at straws x3!
atreeon Aug 19, 2025
dad9af9
clutching at straws x4!
atreeon Aug 19, 2025
0f4259b
clutching at straws x5!
atreeon Aug 19, 2025
3dc9d6c
removed the build file entirely from morphy pubspec and the dart.yml
atreeon Aug 19, 2025
3e1c0e9
final straw clutch
atreeon Aug 19, 2025
8e62595
final straw clutch x1
atreeon Aug 19, 2025
525d800
final straw clutch x2
atreeon Aug 19, 2025
922d2b5
final straw clutch x3
atreeon Aug 19, 2025
866fbe4
final straw clutch x4
atreeon Aug 19, 2025
358a8e0
final straw clutch x5
atreeon Aug 19, 2025
f7defd0
final straw clutch x5
atreeon Aug 19, 2025
93ad3d5
added dummy test to annotation
atreeon Aug 19, 2025
da2a10e
removed analyzer
atreeon Aug 19, 2025
d0f2b9a
warm up added to dart.yml
atreeon Aug 19, 2025
d6a5c79
updated test version
atreeon Aug 19, 2025
214e781
downgraded test version
atreeon Aug 19, 2025
1e26c5a
last throw of dice
atreeon Aug 19, 2025
e7ed543
improve ChangeTo documentation
atreeon Aug 28, 2025
58339cb
try again!
atreeon Aug 28, 2025
2f63bfb
try again x2!
atreeon Aug 28, 2025
4ccfc6b
update test versions
atreeon Aug 28, 2025
d9322e5
moved test to dev_dependencies!
atreeon Aug 28, 2025
df1a37e
use dart test not flutter test
atreeon Aug 28, 2025
cb5c1d3
removed pubspec.lock
atreeon Aug 28, 2025
7c21e4e
Remove pubspec.lock from version control
atreeon Aug 28, 2025
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
96 changes: 73 additions & 23 deletions .github/workflows/dart.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,81 @@
name: Dart CI
name: Build

on: [push]
on:
push:
branches: [ master ]
pull_request:
# schedule:
# - cron: "0 10 * * *"

jobs:
build:

morphy-ci:
runs-on: ubuntu-latest

container:
image: dart:latest
strategy:
matrix:
package:
- morphy_annotation
- morphy
- example
channel: [ stable ]
dependencies: [ get, downgrade ]
exclude:
- channel: stable
dependencies: downgrade

steps:
- uses: actions/checkout@v4
- name: Setup morphy
working-directory: ./morphy
run: |
dart pub get
dart pub run build_runner build --delete-conflicting-outputs
- name: Run tests morphy
working-directory: ./morphy
run: dart pub run test
- name: Setup example
working-directory: ./example
run: |
dart pub get
dart pub run build_runner build --delete-conflicting-outputs
- name: Run tests Example
working-directory: ./example
run: dart pub run test
- uses: actions/checkout@v5

# Use Flutter SDK (brings its own Dart + frontend_server)
- uses: subosito/flutter-action@v2
with:
channel: ${{ matrix.channel }}
cache: ${{ matrix.channel == 'stable' }}

# warm the cache so snapshots exist
- name: Warm Flutter cache
run: |
flutter --version
flutter precache --universal

# (optional) remove example folder inside packages that don't need it; not
# necessary in your layout, but keeping parity with freezed pattern:
# - name: Removing example folder
# if: matrix.package != 'example'
# run: rm -rf example
# working-directory: ${{ matrix.package }}

- name: Install dependencies
run: flutter pub ${{ matrix.dependencies }}
working-directory: ${{ matrix.package }}

# # Check formatting on stable (optional)
# - name: Check format
# if: matrix.channel == 'stable'
# run: dart format --set-exit-if-changed .
# working-directory: ${{ matrix.package }}

# Run codegen only if build_runner is declared
- name: Generate (build_runner)
run: |
if grep -q build_runner "pubspec.yaml"; then
dart pub run build_runner build --delete-conflicting-outputs
fi
working-directory: ${{ matrix.package }}

# # Analyze with Flutter’s analyzer (works for Dart & Flutter pkgs)
# - name: Analyze
# run: flutter analyze
# working-directory: ${{ matrix.package }}

# Choose test runner:
# - use flutter test for the Flutter example
# - use dart test for pure Dart packages
- name: Test
run: |
if grep -q '^flutter:' pubspec.yaml; then
flutter test -r expanded
else
dart test -r expanded
fi
working-directory: ${{ matrix.package }}
65 changes: 65 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Publish to pub.dev

on:
push:
tags:
- 'v*.*.*'

jobs:
publish:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Flutter (macos)
uses: subosito/flutter-action@v2
with:
channel: stable #change this if we are a litte bit behind or have a custom version
flutter-version-file: taskoptimistflutter/pubspec.yaml
#
# - uses: dart-lang/setup-dart@v1
# with:
# sdk: "3.8.2"
- name: Install jq
run: sudo apt-get update && sudo apt-get install -y jq

- name: Run tests for morphy
working-directory: morphy
run: |
dart pub get
dart pub run build_runner build --delete-conflicting-outputs
dart pub run test

- name: Run tests for example
working-directory: example
run: |
dart pub get
dart pub run build_runner clean
dart pub run build_runner build --delete-conflicting-outputs
dart pub run test

- name: Authenticate with pub.dev
env:
PUB_TOKEN: ${{ secrets.PUB_TOKEN }}
run: echo "$PUB_TOKEN" | dart pub token add https://pub.dev

- name: Ensure versions are bumped
run: |
for pkg in morphy_annotation morphy; do
local_ver=$(grep '^version:' "$pkg/pubspec.yaml" | awk '{print $2}')
remote_ver=$(curl -sS "https://pub.dev/api/packages/$pkg" | jq -r '.latest.version')
if [ "$local_ver" = "$remote_ver" ]; then
echo "::error file=$pkg/pubspec.yaml::Version $local_ver already published on pub.dev"
exit 1
fi
done

- name: Publish morphy_annotation
run: dart pub publish --force --directory=morphy_annotation

- name: Dry run publish morphy
run: dart pub publish --dry-run --directory=morphy

- name: Publish morphy
run: dart pub publish --force --directory=morphy
13 changes: 13 additions & 0 deletions RELEASING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Releasing

This project publishes `morphy` and `morphy_annotation` to pub.dev using a GitHub Actions workflow triggered by tags.

1. Update the `version` fields in both `morphy/pubspec.yaml` and `morphy_annotation/pubspec.yaml`.
2. Commit and push the changes.
3. Tag the commit with the new version and push the tag, e.g.:
```bash
git tag -a v1.4.1 -m "Release v1.4.1"
git push origin v1.4.1
```
4. The `publish.yml` workflow will run tests and publish both packages automatically.
5. Check the Actions tab to confirm the release succeeded.
Loading