Update dependency @types/node to v20.17.10 (#739) #2810
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build | |
on: | |
push: | |
branches: | |
- main | |
pull_request: { } | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
build: | |
if: ${{ | |
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) | |
|| (github.event_name == 'push' && !startsWith(github.event.head_commit.message, '[push-back]')) | |
|| github.event_name != 'push' | |
}} | |
name: build | |
runs-on: ubuntu-latest | |
timeout-minutes: 15 | |
concurrency: build-${{github.ref}} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
lfs: true | |
fetch-depth: 1 | |
- name: Read action's Node.js version | |
id: readNodeVersion | |
run: | | |
USING=$( yq .runs.using ./action.yml ) | |
if ! [[ "$USING" =~ ^node[0-9]+$ ]]; then | |
echo "::error::action.yml: .runs.using doesn't start with 'node': '$USING'" | |
exit 1 | |
fi | |
VERSION=${USING:4} | |
echo "Action's Node.js version: $VERSION" | |
echo "result=$VERSION" >> $GITHUB_OUTPUT | |
- name: Setup Node.js ${{steps.readNodeVersion.outputs.result}} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '${{steps.readNodeVersion.outputs.result}}' | |
- name: Update Node.js version in project files | |
run: | | |
node update-node-version-in-files "${{steps.readNodeVersion.outputs.result}}" | |
- name: Restore node_modules cache | |
id: restore-node_modules-cache | |
uses: actions/cache/restore@v4 | |
with: | |
key: ${{runner.os}}-node_modules-${{steps.readNodeVersion.outputs.result}}-${{hashFiles('package.json', '.yarnrc.yml', 'yarn.lock' , '.pnp.*', '.yarn/patches/**', '.yarn/plugins/**', '.yarn/releases/**', '.yarn/versions/**')}} | |
path: | | |
node_modules | |
.yarn/cache | |
- name: Install dependencies | |
if: steps.restore-node_modules-cache.outputs.cache-hit != 'true' | |
run: | | |
yarn install --no-immutable | |
- name: Save node_modules cache | |
if: steps.restore-node_modules-cache.outputs.cache-hit != 'true' | |
uses: actions/cache/save@v4 | |
with: | |
key: ${{runner.os}}-node_modules-${{steps.readNodeVersion.outputs.result}}-${{hashFiles('package.json', '.yarnrc.yml', 'yarn.lock' , '.pnp.*', '.yarn/patches/**', '.yarn/plugins/**', '.yarn/releases/**', '.yarn/versions/**')}} | |
path: | | |
node_modules | |
.yarn/cache | |
- name: Build | |
run: | | |
npm run build | |
- name: Upload dist to artifacts | |
if: ${{always()}} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dist | |
path: dist/ | |
if-no-files-found: error | |
overwrite: true | |
retention-days: 30 | |
# $$$sync-with-template-modifiable: validation $$$ | |
# $$$sync-with-template-modifiable-end$$$ | |
- name: Push back | |
env: | |
PUSH_BACK_TOKEN: ${{secrets.PUSH_BACK_TOKEN}} | |
if: ${{github.event_name == 'push' && startsWith(github.ref, 'refs/heads/') && env.PUSH_BACK_TOKEN}} | |
uses: remal-github-actions/push-back@v1 | |
with: | |
githubToken: ${{env.PUSH_BACK_TOKEN}} | |
message: '[push-back] Push-back updated files during build' | |
- name: Read version | |
id: readVersion | |
if: ${{github.event_name == 'push' && github.ref == 'refs/heads/main'}} | |
uses: remal-github-actions/read-nodejs-package-version@v1 | |
- name: Create tag | |
env: | |
PUSH_BACK_TOKEN: ${{secrets.PUSH_BACK_TOKEN}} | |
if: ${{github.event_name == 'push' && github.ref == 'refs/heads/main' && env.PUSH_BACK_TOKEN}} | |
uses: remal-github-actions/create-tag@v1 | |
with: | |
githubToken: ${{env.PUSH_BACK_TOKEN}} | |
tagName: 'v${{steps.readVersion.outputs.majorVersion}}' | |
forcePush: 'true' |