Skip to content

Commit 25aba68

Browse files
authored
ci: Parallelize LSP release publishing (#12758)
## Summary - Runs VS Code extension/LSP release work in parallel with npm publishing once staging and JS smoke tests pass. - Keeps release PR creation gated on npm publish, tag creation, and extension publish success. - Preserves tag validation for manual LSP publishes while allowing release workflow calls to publish from the staging branch.
1 parent 4084382 commit 25aba68

2 files changed

Lines changed: 20 additions & 13 deletions

File tree

.github/workflows/lsp.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ jobs:
120120
extra-flags: "--frozen-lockfile"
121121

122122
- name: Validate manual publish ref
123-
if: ${{ inputs.publish && !inputs.dry_run }}
123+
if: ${{ github.event_name == 'workflow_dispatch' && inputs.publish && !inputs.dry_run }}
124124
env:
125125
PUBLISH_REF: ${{ inputs.ref || github.ref_name }}
126126
run: |
@@ -217,16 +217,14 @@ jobs:
217217
218218
const marketplaceVersion = `${marketplaceMajor}.${marketplaceMinor}.${marketplacePatch}`;
219219
220-
const releaseTag =
220+
const releaseRef =
221221
process.env.RELEASE_REF ||
222222
(process.env.GITHUB_REF_TYPE === "tag" ? process.env.GITHUB_REF_NAME : "");
223-
if (releaseTag) {
224-
const tagVersion = releaseTag.startsWith("v")
225-
? releaseTag.slice(1)
226-
: releaseTag;
223+
if (releaseRef.startsWith("v")) {
224+
const tagVersion = releaseRef.slice(1);
227225
if (tagVersion !== version) {
228226
throw new Error(
229-
`Release tag ${releaseTag} does not match version.txt ${version}`
227+
`Release tag ${releaseRef} does not match version.txt ${version}`
230228
);
231229
}
232230
}

.github/workflows/turborepo-release.yml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# 1. Create a staging branch (acts as a lock to prevent concurrent releases)
66
# 2. Run some smoke tests on that branch
77
# 3. Build the Rust binary
8-
# 4. Publish JS packages to npm (including turbo itself)
8+
# 4. Publish JS packages to npm and the VS Code extension as parallel worksets
99
# 5. Create the git tag (only after npm publish succeeds)
1010
# 6. Alias versioned docs (e.g., v2-5-4.turborepo.dev)
1111
# 7. Create a release branch and open a PR
@@ -506,15 +506,15 @@ jobs:
506506
507507
publish-vscode-extension:
508508
name: "Publish VS Code Extension"
509-
needs: [stage, create-release-tag]
510-
if: ${{ always() && needs.create-release-tag.result == 'success' && !inputs.dry_run }}
509+
needs: [stage, js-smoke-test]
510+
if: ${{ always() && needs.stage.result == 'success' && needs.js-smoke-test.result == 'success' && !inputs.dry_run }}
511511
permissions:
512512
contents: read
513513
uses: ./.github/workflows/lsp.yml
514514
with:
515515
publish: true
516516
dry_run: false
517-
ref: v${{ needs.stage.outputs.version }}
517+
ref: ${{ needs.stage.outputs.stage-branch }}
518518
secrets: inherit
519519

520520
alias-versioned-docs:
@@ -618,8 +618,15 @@ jobs:
618618

619619
create-release-pr:
620620
name: "Create Release PR"
621-
needs: [stage, npm-publish, create-release-tag, alias-versioned-docs]
622-
if: ${{ always() && needs.npm-publish.result == 'success' && needs.create-release-tag.result == 'success' && !inputs.dry_run }}
621+
needs:
622+
[
623+
stage,
624+
npm-publish,
625+
create-release-tag,
626+
publish-vscode-extension,
627+
alias-versioned-docs
628+
]
629+
if: ${{ always() && needs.npm-publish.result == 'success' && needs.create-release-tag.result == 'success' && needs.publish-vscode-extension.result == 'success' && !inputs.dry_run }}
623630
runs-on: ubuntu-24.04
624631
timeout-minutes: 30
625632
permissions:
@@ -743,6 +750,7 @@ jobs:
743750
js-smoke-test,
744751
npm-publish,
745752
create-release-tag,
753+
publish-vscode-extension,
746754
create-release-pr
747755
]
748756
if: >-
@@ -754,6 +762,7 @@ jobs:
754762
|| needs.js-smoke-test.result == 'failure'
755763
|| needs.npm-publish.result == 'failure'
756764
|| needs.create-release-tag.result == 'failure'
765+
|| needs.publish-vscode-extension.result == 'failure'
757766
|| needs.create-release-pr.result == 'failure'
758767
)
759768
}}

0 commit comments

Comments
 (0)