diff --git a/.github/actions/setup-node/action.yml b/.github/actions/setup-node/action.yml index b6d51d1d42c..268f68fa829 100644 --- a/.github/actions/setup-node/action.yml +++ b/.github/actions/setup-node/action.yml @@ -3,8 +3,8 @@ description: 'Setup NodeJS' inputs: node-version: - required: true - description: 'Node version' + required: false + description: 'Node version. If not provided, read from package.json engines.node' cache-modules: required: false description: 'Cache node_modules' @@ -16,8 +16,8 @@ inputs: description: 'development or production' default: 'development' deno-version: - required: true - description: 'Deno version' + required: false + description: 'Deno version. If not provided, read from .tool-versions' NPM_TOKEN: required: false description: 'NPM token' @@ -38,6 +38,23 @@ runs: using: composite steps: + - name: Resolve tool versions + shell: bash + run: | + NODE_VERSION="${{ inputs.node-version }}" + if [ -z "$NODE_VERSION" ]; then + NODE_VERSION=$(node -p "require('./package.json').engines.node") + fi + echo "NODE_VERSION: ${NODE_VERSION}" + echo "NODE_VERSION=${NODE_VERSION}" >> $GITHUB_ENV + + DENO_VERSION="${{ inputs.deno-version }}" + if [ -z "$DENO_VERSION" ]; then + DENO_VERSION=$(awk '$1=="deno"{ print $2 }' .tool-versions) + fi + echo "DENO_VERSION: ${DENO_VERSION}" + echo "DENO_VERSION=${DENO_VERSION}" >> $GITHUB_ENV + # Turbo local cache: use rharkor/caching-for-turbo in workflows — not stored here to avoid huge redundant keys. - name: Cache Deno (apps-engine) if: inputs.cache-modules @@ -45,21 +62,21 @@ runs: uses: actions/cache@v5 with: path: packages/apps-engine/.deno-cache - key: deno-${{ runner.os }}-${{ runner.arch }}-v${{ inputs.deno-version }}-${{ hashFiles('packages/apps-engine/deno-runtime/deno.lock') }} + key: deno-${{ runner.os }}-${{ runner.arch }}-v${{ env.DENO_VERSION }}-${{ hashFiles('packages/apps-engine/deno-runtime/deno.lock') }} restore-keys: | - deno-${{ runner.os }}-${{ runner.arch }}-v${{ inputs.deno-version }}- + deno-${{ runner.os }}-${{ runner.arch }}-v${{ env.DENO_VERSION }}- - - name: Use Node.js ${{ inputs.node-version }} + - name: Use Node.js ${{ env.NODE_VERSION }} id: node-version uses: actions/setup-node@v6.0.0 with: - node-version: ${{ inputs.node-version }} + node-version: ${{ env.NODE_VERSION }} cache: ${{ inputs.cache-modules && 'yarn' || '' }} - - name: Use Deno ${{ inputs.deno-version }} + - name: Use Deno ${{ env.DENO_VERSION }} uses: denoland/setup-deno@667a34cdef165d8d2b2e98dde39547c9daac7282 # v2.0.4 with: - deno-version: ${{ inputs.deno-version }} + deno-version: ${{ env.DENO_VERSION }} - name: Cache mongodb-memory-server binary if: inputs.cache-modules diff --git a/.github/workflows/ci-deploy-gh-pages.yml b/.github/workflows/ci-deploy-gh-pages.yml index 55ce500ef10..2b70e76c309 100644 --- a/.github/workflows/ci-deploy-gh-pages.yml +++ b/.github/workflows/ci-deploy-gh-pages.yml @@ -17,8 +17,6 @@ jobs: - name: Setup NodeJS uses: ./.github/actions/setup-node with: - node-version: 22.16.0 - deno-version: 2.3.1 cache-modules: true install: true diff --git a/.github/workflows/new-release.yml b/.github/workflows/new-release.yml index a1bf455c557..69a21f064cd 100644 --- a/.github/workflows/new-release.yml +++ b/.github/workflows/new-release.yml @@ -34,8 +34,6 @@ jobs: - name: Setup NodeJS uses: ./.github/actions/setup-node with: - node-version: 22.16.0 - deno-version: 2.3.1 cache-modules: true install: true NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/pr-update-description.yml b/.github/workflows/pr-update-description.yml index 4ce56b5431a..46d1c9a3f73 100644 --- a/.github/workflows/pr-update-description.yml +++ b/.github/workflows/pr-update-description.yml @@ -21,8 +21,6 @@ jobs: - name: Setup NodeJS uses: ./.github/actions/setup-node with: - node-version: 22.16.0 - deno-version: 2.3.1 cache-modules: true install: true NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index c945b163e44..e9b0c3ab41e 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -24,8 +24,6 @@ jobs: - name: Setup NodeJS uses: ./.github/actions/setup-node with: - node-version: 22.16.0 - deno-version: 2.3.1 cache-modules: true install: true NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/release-candidate.yml b/.github/workflows/release-candidate.yml index 73344bdb096..9652823bcd5 100644 --- a/.github/workflows/release-candidate.yml +++ b/.github/workflows/release-candidate.yml @@ -15,8 +15,6 @@ jobs: - name: Setup NodeJS uses: ./.github/actions/setup-node with: - node-version: 22.16.0 - deno-version: 2.3.1 cache-modules: true install: true NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/packages/apps-engine/turbo.json b/packages/apps-engine/turbo.json index a07ebf0886a..966596e7435 100644 --- a/packages/apps-engine/turbo.json +++ b/packages/apps-engine/turbo.json @@ -3,6 +3,7 @@ "tasks": { "build": { "dependsOn": ["^build"], + "inputs": ["$TURBO_DEFAULT$", "$TURBO_ROOT$/.tool-versions"], "outputs": ["client/**", "definition/**", "deno-runtime/**", "lib/**", "scripts/**", "server/**", ".deno-cache/**"] } }