diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..810a6a4 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,36 @@ +name: PR Pipeline + +on: + pull_request: + branches: + - main + +jobs: + validate: + name: Validate package + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Flutter + uses: subosito/flutter-action@v2 + with: + channel: stable + cache: true + + - name: Install dependencies + run: flutter pub get + + - name: Verify formatting + run: dart format --output=none --set-exit-if-changed . + + - name: Analyze + run: flutter analyze + + # - name: Run tests + # run: flutter test + + - name: Pub publish dry run + run: dart pub publish --dry-run diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..0a7fa53 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,34 @@ +name: Publish to pub.dev + +on: + push: + tags: + - "v[0-9]+.[0-9]+.[0-9]+" + +permissions: + contents: read + +jobs: + verify-tag-on-main: + name: Verify tag commit is on main + runs-on: ubuntu-latest + + steps: + - name: Checkout full history + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Verify tagged commit belongs to main + run: | + git fetch origin main + git merge-base --is-ancestor "$GITHUB_SHA" "origin/main" || { + echo "Tag is not on main. Publishing is blocked." + exit 1 + } + + publish: + needs: verify-tag-on-main + permissions: + id-token: write + uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1 diff --git a/CHANGELOG.md b/CHANGELOG.md index a527b4b..8964210 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,11 +1,12 @@ -## 0.2.0-beta.1 - 2026-02-13 +## 0.2.0-beta.2 - 2026-02-13 Reclassified `mt_audio` as a beta release while testing is ongoing. ### Changed -- Updated package version to `0.2.0-beta.1`. +- Updated package version to `0.2.0-beta.2`. - Updated README wording from production-ready to beta. +- Updated GitHub workflow branch references from `master` to `main`. ### Breaking changes diff --git a/example/lib/providers/player_provider.dart b/example/lib/providers/player_provider.dart index e6750f6..85ad765 100644 --- a/example/lib/providers/player_provider.dart +++ b/example/lib/providers/player_provider.dart @@ -14,7 +14,8 @@ class PlayerProvider extends InheritedWidget { /// Gets the player from the widget tree. static MtAudioPlayer of(BuildContext context) { - final provider = context.dependOnInheritedWidgetOfExactType(); + final provider = context + .dependOnInheritedWidgetOfExactType(); assert(provider != null, 'No PlayerProvider found in context'); return provider!.player; } diff --git a/pubspec.yaml b/pubspec.yaml index 0bba781..93be095 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: mt_audio -version: 0.2.0-beta.1 +version: 0.2.0-beta.2 description: A beta, streams-based Flutter audio package with background playback, queue management, Android Auto, and Apple CarPlay support. homepage: https://github.com/mobitouchOS/mt_audio repository: https://github.com/mobitouchOS/mt_audio