Ensure clean git state before pub.dev dry-run in CI
Add step to create a temporary commit for staged native binaries and pubspec.yaml, preventing pub.dev validation failures on modified files. Update documentation to clarify this requirement.
keypair34 committed
May 3, 2026 at 14:14 UTC
0db320c08d2a236868b2535c3a725648c06800df
2 files changed
+28
-8
.agents/skills/distribution/SKILL.md
+7
@@ -156,6 +156,12 @@ Run these during verification:
156
- `dart analyze pub/onde_cli`
157
- `dart pub publish --dry-run --directory pub/onde_cli`
158
159
+One more gotcha:
160
+
161
+- pub.dev validation expects a clean git state
162
+- if CI stages native binaries into `pub/onde_cli/native/`, make a temporary local commit after staging those files and syncing `pubspec.yaml`
163
+- staging alone is not enough, because `dart pub publish --dry-run` will warn on modified checked-in files and fail the job
164
+
165
## NuGet-specific notes
166
167
NuGet packaging is sensitive to path layout.
@@ -212,6 +218,7 @@ At minimum, check:
218
- staged native binaries land in the wrong directory before packaging
219
- package builds successfully but installs without the native binary
220
- pub.dev package omits staged assets because gitignore excludes them
221
+- pub.dev dry-run fails because CI staged native files but never created a clean local commit
222
- smoke test invokes a TUI-first binary in a way that does not make sense for CI
223
- README badges and install commands drift out of sync with real package names
224
.github/workflows/release-pub.yml
+21
-8
@@ -132,10 +132,6 @@ jobs:
132
path: pub/onde_cli/native
133
merge-multiple: true
134
135
- - name: Stage generated native binaries
136
- shell: bash
137
- run: git add -f pub/onde_cli/native
138
-
135
- name: Setup Dart SDK
136
uses: dart-lang/setup-dart@v1
137
@@ -154,6 +150,16 @@ jobs:
150
pubspec.write_text('\n'.join(lines) + '\n')
151
PY
152
153
+ - name: Create temporary clean git state
154
+ shell: bash
155
+ run: |
156
+ git config user.name "github-actions[bot]"
157
+ git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
158
+ git add -f pub/onde_cli/native pub/onde_cli/pubspec.yaml
159
+ if ! git diff --cached --quiet; then
160
+ git commit -m "Stage pub.dev release assets for ${RELEASE_VERSION}"
161
+ fi
162
+
163
- name: Get package dependencies
164
working-directory: pub/onde_cli
165
run: dart pub get
@@ -194,10 +200,6 @@ jobs:
200
path: pub/onde_cli/native
201
merge-multiple: true
202
197
- - name: Stage generated native binaries
198
- shell: bash
199
- run: git add -f pub/onde_cli/native
200
-
203
- name: Setup Dart SDK
204
uses: dart-lang/setup-dart@v1
205
@@ -228,6 +230,17 @@ jobs:
230
echo "exists=false" >> "$GITHUB_OUTPUT"
231
fi
232
233
+ - name: Create temporary clean git state
234
+ if: steps.pub-check.outputs.exists != 'true'
235
+ shell: bash
236
+ run: |
237
+ git config user.name "github-actions[bot]"
238
+ git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
239
+ git add -f pub/onde_cli/native pub/onde_cli/pubspec.yaml
240
+ if ! git diff --cached --quiet; then
241
+ git commit -m "Stage pub.dev release assets for ${RELEASE_VERSION}"
242
+ fi
243
+
244
- name: Set up pub.dev credentials
245
if: steps.pub-check.outputs.exists != 'true'
246
shell: bash