Skip to content

Commit e3f2b1c

Browse files
authored
chore(ci): support custom turbo version for ci (#9913)
### Description Our release flow installs the most recent version of turbo to run tests even if it's deprecated. This allows that to be overriden so we can still release forward after a bad release. ### Testing Instructions <!-- Give a quick description of steps to test your changes. -->
1 parent 8a2fac2 commit e3f2b1c

File tree

2 files changed

+30
-4
lines changed

2 files changed

+30
-4
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,29 @@
11
name: "Install Global Turbo"
22
description: "Installs turbo globally. Expects Node and npm to already be installed"
33

4+
inputs:
5+
turbo-version:
6+
description: "Specify a Turbo version or tag (e.g., 2.0.5, latest, beta, canary)"
7+
required: false
8+
default: ""
9+
410
runs:
511
using: "composite"
612
steps:
13+
- name: Determine Turbo Version
14+
id: determine-version
15+
shell: bash
16+
run: |
17+
if [[ -n "${{ inputs.turbo-version }}" ]]; then
18+
VERSION="${{ inputs.turbo-version }}"
19+
else
20+
VERSION=$(npm view turbo --json | jq -r '.versions | map(select(test("^2\\."))) | last')
21+
echo "No version provided, using latest 2.x version: $VERSION"
22+
fi
23+
echo "TURBO_VERSION=$VERSION" >> $GITHUB_ENV
24+
725
- name: Install Turbo globally
826
shell: bash
927
run: |
10-
VERSION=$(npm view turbo --json | jq -r '.versions | map(select(test("2."))) | last')
11-
echo "Latest published version: $VERSION"
12-
npm i -g turbo@$VERSION
28+
echo "Installing turbo@$TURBO_VERSION..."
29+
npm i -g turbo@$TURBO_VERSION

.github/workflows/turborepo-release.yml

+10-1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ on:
4747
description: "Override default npm dist-tag for the release. Should only be used for backporting"
4848
required: false
4949
type: string
50+
ci-tag-override:
51+
description: "Override default npm dist-tag to use for running tests. Should only be used when the most recent release was faulty"
52+
required: false
53+
type: string
54+
default: ""
5055

5156
jobs:
5257
stage:
@@ -107,6 +112,8 @@ jobs:
107112
node-version: "20"
108113
- name: Install Global Turbo
109114
uses: ./.github/actions/install-global-turbo
115+
with:
116+
turbo-version: "${{ github.event.inputs.ci-tag-override }}"
110117
- name: Run JS Package Tests
111118
run: turbo run check-types test --filter="./packages/*" --color
112119

@@ -207,7 +214,9 @@ jobs:
207214
enable-corepack: false
208215

209216
- name: Install Global Turbo
210-
uses: ./.github/actions/install-global-turbo
217+
uses: ./.github/actions/
218+
with:
219+
turbo-version: "${{ github.event.inputs.ci-tag-override }}"
211220

212221
- name: Configure git
213222
run: |

0 commit comments

Comments
 (0)