Skip to content

Commit f3882cc

Browse files
committed
Publish to marketplace before creating GitHub release
- Marketplace publish is the fragile step (external service, PAT expiry); running it first avoids orphaned GH releases when it fails - Recovery via `npm run retag` is now sufficient -- no version bump needed - Update docs to reflect new step order and simplified recovery
1 parent ff34322 commit f3882cc

3 files changed

Lines changed: 12 additions & 18 deletions

File tree

.github/workflows/ci.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -175,16 +175,16 @@ jobs:
175175
fi
176176
echo "All VSIX contents verified"
177177
178+
- name: Publish to marketplace
179+
if: ${{ !inputs.dry_run && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main') }}
180+
run: npm run publish -- --packagePath git-crypt-vscode-*.vsix
181+
env:
182+
VSCE_PAT: ${{ secrets.VSCE_PAT }}
183+
178184
- name: Create or update GitHub release
179185
if: startsWith(github.ref, 'refs/tags/v') && !inputs.dry_run
180186
run: |
181187
gh release create "$GITHUB_REF_NAME" git-crypt-vscode-*.vsix --title "$GITHUB_REF_NAME" --generate-notes ||
182188
gh release upload "$GITHUB_REF_NAME" git-crypt-vscode-*.vsix --clobber
183189
env:
184190
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
185-
186-
- name: Publish to marketplace
187-
if: ${{ !inputs.dry_run && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main') }}
188-
run: npm run publish -- --packagePath git-crypt-vscode-*.vsix
189-
env:
190-
VSCE_PAT: ${{ secrets.VSCE_PAT }}

CLAUDE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ Tests create a temporary git-crypt repo via `test/fixture.ts` (requires `git-cry
4848
1. **preversion** -- branch guard (must be on `main`), build, test
4949
2. Version bump, commit, `v*` tag
5050
3. **postversion** -- pushes commit + tag to origin
51-
4. CI: tests -> build static binaries -> package platform-specific + universal VSIX -> GitHub release -> marketplace publish
51+
4. CI: tests -> build static binaries -> package platform-specific + universal VSIX -> marketplace publish -> GitHub release
5252

53-
Recovery from CI failure: `npm run retag` (force-moves tag to HEAD, re-triggers CI). If marketplace publish fails after GH release succeeds, bump version and release again (marketplace rejects same-version re-publishes).
53+
Recovery from CI failure: `npm run retag` (force-moves tag to HEAD, re-triggers CI). Marketplace publish runs before GH release creation, so a publish failure leaves no orphaned release to clean up.
5454

5555
Dry runs: `gh workflow run ci.yml --ref dev` runs the full build/package pipeline with `dry_run=true` (default). Marketplace publish is also guarded against non-main branches.
5656

CONTRIBUTING.md

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ CI then takes over:
6060
6. Validates the tag is on `main` and matches package.json version
6161
7. Builds static git-crypt binaries for macOS (arm64) and Linux (x64, arm64)
6262
8. Packages platform-specific VSIX files (with bundled binary) and a universal VSIX (without)
63-
9. Creates a GitHub release with all VSIX files attached
64-
10. Publishes all VSIX files to the VS Code Marketplace
63+
9. Publishes all VSIX files to the VS Code Marketplace
64+
10. Creates a GitHub release with all VSIX files attached
6565

6666
### Dry Runs
6767

@@ -75,19 +75,13 @@ This runs with `dry_run=true` (the default), which builds binaries, packages VSI
7575

7676
### Recovery
7777

78-
**CI fails before publish** (tests, build, packaging): fix the issue and retag:
78+
**CI fails before or during publish**: fix the issue and retag:
7979

8080
```bash
8181
npm run retag
8282
```
8383

84-
This force-moves the tag to the current commit and pushes it, re-triggering CI.
85-
86-
**Marketplace publish fails after GitHub release succeeds**: the marketplace rejects same-version re-publishes, so `retag` alone won't work. Bump the version and release again:
87-
88-
```bash
89-
npm version patch
90-
```
84+
This force-moves the tag to the current commit and pushes it, re-triggering CI. Marketplace publish runs before GitHub release creation, so a publish failure leaves no orphaned release to clean up.
9185

9286
### Branches
9387

0 commit comments

Comments
 (0)