@@ -4,19 +4,16 @@ This guide explains how to release new versions of the Vapi Flutter SDK to pub.d
44
55## Initial Setup (One-time)
66
7- ### 1. Get pub.dev credentials
7+ ### Enable Automated Publishing on pub.dev
88
9- ``` bash
10- ./scripts/get_pub_credentials.sh
11- ```
12-
13- If not logged in yet: ` flutter pub login `
14-
15- ### 2. Add to GitHub Secrets
9+ 1 . Go to [ pub.dev] ( https://pub.dev ) and sign in
10+ 2 . Navigate to your package page
11+ 3 . Go to the ** Admin** tab
12+ 4 . Under ** Automated Publishing** , click ** Enable publishing from GitHub Actions**
13+ 5 . Enter your repository: ` <your-github-username>/<your-repository-name> `
14+ 6 . Set tag pattern: ` v{{version}} `
1615
17- 1 . Go to Settings → Secrets and variables → Actions
18- 2 . Add new secret: ` PUB_CREDENTIALS `
19- 3 . Paste the JSON content from step 1
16+ ** Note:** You must be a verified publisher or have uploader permissions on the package.
2017
2118## Release Process
2219
@@ -50,32 +47,60 @@ version: 0.2.0 # Update accordingly
5047- Renamed method `oldName()` to `newName()`
5148` ` `
5249
53- ### 3. Commit and push
50+ ### 3. Run validation checks
51+
52+ Before committing, ensure all checks pass locally:
53+
54+ ` ` ` bash
55+ ./scripts/run_checks.sh
56+ ```
57+
58+ This script runs the same checks as CI:
59+
60+ - Code formatting
61+ - Static analysis
62+ - Unit tests
63+ - pub.dev score check
64+ - Package validation
65+
66+ ### 4. Commit and push
5467
5568``` bash
5669git add pubspec.yaml CHANGELOG.md
5770git commit -m " chore: bump version to 0.2.0"
5871git push origin main
5972```
6073
61- ### 4 . Create GitHub Release
74+ ### 5 . Create and push tag
6275
63- 1 . Go to Releases → Create a new release
64- 2 . Create tag: ` v0.2.0 ` (with 'v' prefix)
65- 3 . Title: ` v0.2.0 `
66- 4 . Copy notes from CHANGELOG.md
67- 5 . Publish release
76+ ``` bash
77+ # Create tag matching the version
78+ git tag v0.2.0
6879
69- The GitHub Action will automatically publish to pub.dev.
80+ # Push the tag to trigger publishing
81+ git push origin v0.2.0
82+ ```
83+
84+ The GitHub Action will automatically publish to pub.dev using OIDC authentication.
7085
71- ### 5 . Monitor
86+ ### 6 . Monitor
7287
7388Check the Actions tab for the "Publish to pub.dev" workflow status.
7489
90+ ### 7. Create GitHub Release (Optional)
91+
92+ After successful publishing, you can create a GitHub release:
93+
94+ 1 . Go to Releases → Create a new release
95+ 2 . Choose existing tag: ` v0.2.0 `
96+ 3 . Title: ` v0.2.0 `
97+ 4 . Copy notes from CHANGELOG.md
98+ 5 . Publish release
99+
75100## Troubleshooting
76101
77- - ** Tests failing ** : Fix and create new release
78- - ** Credentials issue ** : Verify ` PUB_CREDENTIALS ` secret
102+ - ** Workflow not triggering ** : Ensure tag matches pattern ` v{{version}} `
103+ - ** Authentication failed ** : Verify automated publishing is enabled on pub.dev
79104- ** Version conflict** : Ensure version bump in pubspec.yaml
80105- ** Manual fallback** : ` flutter pub publish `
81106
0 commit comments