chore(ci): improve node and deno version handling (#40159)

pull/40131/head^2
Douglas Gubert 3 weeks ago committed by GitHub
parent e792aba7f5
commit df36a852f9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 37
      .github/actions/setup-node/action.yml
  2. 2
      .github/workflows/ci-deploy-gh-pages.yml
  3. 2
      .github/workflows/new-release.yml
  4. 2
      .github/workflows/pr-update-description.yml
  5. 2
      .github/workflows/publish-release.yml
  6. 2
      .github/workflows/release-candidate.yml
  7. 1
      packages/apps-engine/turbo.json

@ -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

@ -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

@ -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 }}

@ -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 }}

@ -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 }}

@ -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 }}

@ -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/**"]
}
}

Loading…
Cancel
Save