httpcat-cli 0.2.1-rc.4 → 0.2.2-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -30,9 +30,15 @@ jobs:
30
30
  contents: read
31
31
 
32
32
  publish-release:
33
+ # Skip if commit message is a version bump (to prevent infinite loop)
33
34
  if: |
34
- (github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))) ||
35
- github.event_name == 'workflow_dispatch'
35
+ github.event_name == 'workflow_dispatch' ||
36
+ startsWith(github.ref, 'refs/tags/v') ||
37
+ (github.event_name == 'push' &&
38
+ github.ref == 'refs/heads/main' &&
39
+ (!github.event.head_commit ||
40
+ (!startsWith(github.event.head_commit.message, 'chore: bump version') &&
41
+ !startsWith(github.event.head_commit.message, 'chore: sync version'))))
36
42
  uses: ./.github/workflows/release.yml
37
43
  with:
38
44
  version: ${{ github.event.inputs.version }}
@@ -271,6 +271,31 @@ jobs:
271
271
  echo "✅ Tag $TAG created and pushed"
272
272
  fi
273
273
 
274
+ - name: Commit version update back to main
275
+ if: github.event_name == 'push' && github.ref == 'refs/heads/main'
276
+ run: |
277
+ CURRENT_VERSION=$(node -p "require('./package.json').version")
278
+ RELEASE_VERSION="${{ steps.version.outputs.version }}"
279
+
280
+ if [ "$CURRENT_VERSION" != "$RELEASE_VERSION" ]; then
281
+ echo "⚠️ Version mismatch: package.json has $CURRENT_VERSION but release is $RELEASE_VERSION"
282
+ echo "This shouldn't happen - the version should have been updated earlier in the workflow"
283
+ exit 1
284
+ fi
285
+
286
+ # Check if package.json has uncommitted changes
287
+ if git diff --quiet package.json; then
288
+ echo "✅ package.json version already committed"
289
+ else
290
+ echo "Committing version update to main..."
291
+ git config user.name "github-actions[bot]"
292
+ git config user.email "github-actions[bot]@users.noreply.github.com"
293
+ git add package.json
294
+ git commit -m "chore: bump version to $RELEASE_VERSION"
295
+ git push origin main
296
+ echo "✅ Version update committed to main"
297
+ fi
298
+
274
299
  - name: Generate release notes
275
300
  id: notes
276
301
  uses: actions/github-script@v8
@@ -520,7 +545,7 @@ jobs:
520
545
  uses: actions/checkout@v6
521
546
  with:
522
547
  repository: hathbanger/homebrew-httpcat
523
- token: ${{ secrets.GITHUB_TOKEN }}
548
+ token: ${{ secrets.HOMEBREW_TAP_TOKEN }}
524
549
  path: homebrew-tap
525
550
 
526
551
  - name: Wait for npm CDN propagation
@@ -575,7 +600,8 @@ jobs:
575
600
  git config user.email "github-actions[bot]@users.noreply.github.com"
576
601
  git add Formula/httpcat.rb
577
602
  git commit -m "Update httpcat to ${{ needs.prepare.outputs.version }}" || exit 0
578
- git push
603
+ git remote set-url origin https://${{ secrets.HOMEBREW_TAP_TOKEN }}@github.com/hathbanger/homebrew-httpcat.git
604
+ git push origin main
579
605
 
580
606
  # Job 5: Create GitHub Release
581
607
  create-release:
@@ -0,0 +1,56 @@
1
+ name: Sync Version to Develop
2
+
3
+ # This workflow runs after a release to sync the version from main back to develop
4
+ on:
5
+ release:
6
+ types: [published]
7
+
8
+ jobs:
9
+ sync-version:
10
+ name: Sync version to develop
11
+ runs-on: ubuntu-latest
12
+ permissions:
13
+ contents: write
14
+ steps:
15
+ - name: Checkout code
16
+ uses: actions/checkout@v6
17
+ with:
18
+ fetch-depth: 0
19
+ token: ${{ secrets.GITHUB_TOKEN }}
20
+
21
+ - name: Get version from release
22
+ id: version
23
+ run: |
24
+ VERSION="${{ github.event.release.tag_name }}"
25
+ # Remove 'v' prefix if present
26
+ VERSION="${VERSION#v}"
27
+ echo "version=$VERSION" >> $GITHUB_OUTPUT
28
+ echo "✅ Version to sync: $VERSION"
29
+
30
+ - name: Checkout develop branch
31
+ run: |
32
+ git checkout develop
33
+ git pull origin develop
34
+
35
+ - name: Update package.json version
36
+ run: |
37
+ VERSION="${{ steps.version.outputs.version }}"
38
+ npm version "$VERSION" --no-git-tag-version --allow-same-version
39
+ echo "✅ Updated package.json to version $VERSION"
40
+
41
+ - name: Commit and push to develop
42
+ run: |
43
+ VERSION="${{ steps.version.outputs.version }}"
44
+ git config user.name "github-actions[bot]"
45
+ git config user.email "github-actions[bot]@users.noreply.github.com"
46
+ git add package.json
47
+
48
+ # Check if there are changes to commit
49
+ if git diff --staged --quiet; then
50
+ echo "✅ package.json already at version $VERSION, nothing to commit"
51
+ else
52
+ git commit -m "chore: sync version to $VERSION"
53
+ git push origin develop
54
+ echo "✅ Version synced to develop"
55
+ fi
56
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "httpcat-cli",
3
- "version": "0.2.1-rc.4",
3
+ "version": "0.2.2-rc.1",
4
4
  "description": "CLI tool for interacting with httpcat agent - create, buy, and sell tokens with x402 payments",
5
5
  "main": "dist/index.js",
6
6
  "bin": {