httpcat-cli 0.0.27-rc.1 → 0.0.27-rc.3

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.
@@ -11,9 +11,23 @@ Continuous Integration workflow that runs on every push and pull request:
11
11
  - Security audits
12
12
  - Code coverage reporting
13
13
 
14
+ ### `publish-switch.yml`
15
+ Entry point workflow for npm trusted publishing (OIDC). This is the workflow that npm validates against.
16
+ - Routes to either `rc-publish.yml` (for develop branch) or `release.yml` (for main branch/tags)
17
+ - Contains OIDC permissions required for trusted publishing
18
+ - This is the workflow file that must be configured in npm's Trusted Publishers settings
19
+
20
+ ### `rc-publish.yml`
21
+ Reusable workflow for publishing Release Candidate versions:
22
+ - Called by `publish-switch.yml` when pushing to `develop` branch
23
+ - Automatically increments RC version number
24
+ - Publishes to npm with `rc` tag
25
+ - Does not create GitHub releases
26
+
14
27
  ### `release.yml`
15
- Automated release workflow that:
16
- - Triggers on version tags (v*.*.*) or manual dispatch
28
+ Reusable workflow for publishing official releases:
29
+ - Called by `publish-switch.yml` when pushing to `main` branch or version tags
30
+ - Auto-detects version bump from conventional commits (BREAKING/feat/fix)
17
31
  - Validates version format
18
32
  - Runs tests and builds
19
33
  - Publishes to npm
@@ -35,10 +49,12 @@ Manual workflow to update the Homebrew formula in the tap repository.
35
49
  4. Select **"GitHub Actions"**
36
50
  5. Configure:
37
51
  - **Repository**: `hathbanger/httpcat-cli`
38
- - **Workflow file**: `.github/workflows/rc-publish.yml` (for RC) or `.github/workflows/release.yml` (for releases)
52
+ - **Workflow file**: `.github/workflows/publish-switch.yml` (this is the entry point that routes to RC or release)
39
53
  - **Environment name**: `npm-publish` (optional, if using environments)
40
54
  6. Save the configuration
41
55
 
56
+ **Important:** Only `publish-switch.yml` needs to be configured as the trusted publisher. It will automatically route to the correct workflow (RC or release) based on the trigger.
57
+
42
58
  **Benefits:**
43
59
  - ✅ No tokens needed - uses OIDC authentication
44
60
  - ✅ Bypasses 2FA requirements automatically
@@ -0,0 +1,41 @@
1
+ name: Publish Switch
2
+
3
+ # This is the entry point workflow that npm will trust for OIDC publishing
4
+ # It conditionally calls either the RC or Release workflow based on the trigger
5
+
6
+ on:
7
+ push:
8
+ branches:
9
+ - develop # RC publishing
10
+ - main # Release publishing
11
+ tags:
12
+ - "v*.*.*" # Release publishing via tags
13
+ workflow_dispatch:
14
+ inputs:
15
+ version:
16
+ description: "Version to release (e.g., 1.2.3). Leave empty for auto-detection from commits."
17
+ required: false
18
+ type: string
19
+
20
+ permissions:
21
+ id-token: write # Required for OIDC to request ID token to authenticate workflow
22
+ contents: write # Required for creating tags and releases
23
+
24
+ jobs:
25
+ publish-rc:
26
+ if: github.event_name == 'push' && github.ref == 'refs/heads/develop'
27
+ uses: ./.github/workflows/rc-publish.yml
28
+ permissions:
29
+ id-token: write
30
+ contents: read
31
+
32
+ publish-release:
33
+ if: |
34
+ (github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))) ||
35
+ github.event_name == 'workflow_dispatch'
36
+ uses: ./.github/workflows/release.yml
37
+ with:
38
+ version: ${{ github.event.inputs.version }}
39
+ permissions:
40
+ id-token: write
41
+ contents: write
@@ -1,9 +1,9 @@
1
1
  name: RC Publish
2
2
 
3
+ # This is a reusable workflow called by publish-switch.yml
3
4
  on:
4
- push:
5
- branches:
6
- - develop
5
+ workflow_call:
6
+ # No inputs needed for RC publishing
7
7
 
8
8
  env:
9
9
  NODE_VERSION: "20"
@@ -1,12 +1,8 @@
1
1
  name: Release
2
2
 
3
+ # This is a reusable workflow called by publish-switch.yml
3
4
  on:
4
- push:
5
- branches:
6
- - main
7
- tags:
8
- - "v*.*.*" # Triggers on semantic version tags (e.g., v1.2.3)
9
- workflow_dispatch:
5
+ workflow_call:
10
6
  inputs:
11
7
  version:
12
8
  description: "Version to release (e.g., 1.2.3). Leave empty for auto-detection from commits."
@@ -52,9 +48,12 @@ jobs:
52
48
 
53
49
  let version;
54
50
 
55
- if (context.eventName === 'workflow_dispatch' && context.payload.inputs.version) {
56
- // Manual workflow dispatch with version provided
57
- version = context.payload.inputs.version.replace(/^v/, '');
51
+ // Check if version was passed as input (from workflow_call)
52
+ const workflowInputVersion = '${{ inputs.version }}';
53
+ if (workflowInputVersion && workflowInputVersion !== '' && workflowInputVersion !== 'null') {
54
+ // Version provided via workflow_call input
55
+ version = workflowInputVersion.replace(/^v/, '');
56
+ console.log(`Using provided version: ${version}`);
58
57
  } else if (context.ref.startsWith('refs/tags/')) {
59
58
  // Tag-based release
60
59
  version = context.ref.replace('refs/tags/v', '');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "httpcat-cli",
3
- "version": "0.0.27-rc.1",
3
+ "version": "0.0.27-rc.3",
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": {