Skip to content

Added github actions to publish on release #19

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jun 25, 2025
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
36 changes: 36 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: CI

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.27.0'
channel: 'stable'

- name: Install dependencies
run: flutter pub get

- name: Analyze code
run: flutter analyze

# - name: Run tests
# run: flutter test

- name: Check formatting
run: dart format --set-exit-if-changed .

- name: Check publish readiness
run: flutter pub publish --dry-run
56 changes: 56 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Publish to pub.dev

on:
release:
types: [published]

jobs:
publish:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.27.0'
channel: 'stable'

- name: Verify version consistency
run: |
# Extract version from pubspec.yaml
PUBSPEC_VERSION=$(grep '^version: ' pubspec.yaml | sed 's/version: //')
# Remove 'v' prefix from tag if present
TAG_VERSION=${GITHUB_REF_NAME#v}

echo "Tag version: $TAG_VERSION"
echo "Pubspec version: $PUBSPEC_VERSION"

if [ "$TAG_VERSION" != "$PUBSPEC_VERSION" ]; then
echo "Error: Tag version ($TAG_VERSION) does not match pubspec.yaml version ($PUBSPEC_VERSION)"
echo "Please ensure your tag matches the version in pubspec.yaml"
exit 1
fi

echo "✓ Version check passed!"

- name: Install dependencies
run: flutter pub get

- name: Setup Dart credentials
run: |
mkdir -p ~/.pub-cache
echo '${{ secrets.PUB_CREDENTIALS }}' > ~/.pub-cache/credentials.json

- name: Verify package scores
run: |
echo "Running package verification..."
flutter pub publish --dry-run

- name: Publish to pub.dev
run: |
# Using --force because this runs in CI without user interaction
# The dry-run above ensures the package is valid before publishing
flutter pub publish --force
40 changes: 38 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,39 @@
## 0.0.1
# Changelog

* TODO: Describe initial release.
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [0.1.0] - 2024-02-12

### Added

- Initial release of Vapi Flutter SDK
- Unified mobile and web support
- Real-time voice conversation capabilities
- Assistant configuration and customization
- Event-based communication system
- Support for custom messages and interruptions
- Comprehensive error handling
- Platform-specific optimizations for mobile (iOS/Android) and web

### Platform Support

- iOS: Microphone permissions and audio session handling
- Android: Required permissions for audio recording
- Web: Dynamic SDK loading via CDN

### Dependencies

- Mobile: daily_flutter for WebRTC support
- Web: Vapi Web SDK loaded dynamically
- Cross-platform HTTP client support

## [0.2.0] - 2025-06-25

### Added

- Updated the dependencies of daily_flutter and others to latest version
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,4 +226,14 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```
```

## Contributing

### Development Setup

For detailed instructions on setting up your development environment, please see [SETUP.md](SETUP.md).

### Releasing

For information on how to release new versions to pub.dev, please see [RELEASE.md](RELEASE.md).
92 changes: 92 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# Releasing to pub.dev

This guide explains how to release new versions of the Vapi Flutter SDK to pub.dev using GitHub releases.

## Initial Setup (One-time)

### 1. Get pub.dev credentials

```bash
./scripts/get_pub_credentials.sh
```

If not logged in yet: `flutter pub login`

### 2. Add to GitHub Secrets

1. Go to Settings → Secrets and variables → Actions
2. Add new secret: `PUB_CREDENTIALS`
3. Paste the JSON content from step 1

## Release Process

### 1. Update version in pubspec.yaml

Follow semantic versioning:

- **MAJOR** (1.0.0 → 2.0.0): Breaking changes
- **MINOR** (0.1.0 → 0.2.0): New features, improvements, bug fixes
- **PATCH** (0.1.0 → 0.1.1): Bug fixes only

```yaml
version: 0.2.0 # Update accordingly
```

### 2. Update CHANGELOG.md

```markdown
## [0.2.0] - 2025-06-25

### Added
- New feature X

### Fixed
- Bug where Z happened

### Changed
- Improved performance of B

### Breaking Changes # For major versions only
- Renamed method `oldName()` to `newName()`
```

### 3. Commit and push

```bash
git add pubspec.yaml CHANGELOG.md
git commit -m "chore: bump version to 0.2.0"
git push origin main
```

### 4. Create GitHub Release

1. Go to Releases → Create a new release
2. Create tag: `v0.2.0` (with 'v' prefix)
3. Title: `v0.2.0`
4. Copy notes from CHANGELOG.md
5. Publish release

The GitHub Action will automatically publish to pub.dev.

### 5. Monitor

Check the Actions tab for the "Publish to pub.dev" workflow status.

## Troubleshooting

- **Tests failing**: Fix and create new release
- **Credentials issue**: Verify `PUB_CREDENTIALS` secret
- **Version conflict**: Ensure version bump in pubspec.yaml
- **Manual fallback**: `flutter pub publish`

## Best Practices

1. Test locally: `flutter test` and `flutter pub publish --dry-run`
2. Follow semantic versioning strictly
3. Keep CHANGELOG updated
4. Always release from main branch
5. Use consistent tag format: `vX.Y.Z`

## Version Examples

- `0.1.0`
Loading