Skip to content

ci: use .node-version file in GitHub Actions #223

ci: use .node-version file in GitHub Actions

ci: use .node-version file in GitHub Actions #223

Workflow file for this run

name: Main
on:
push:
branches:
- main
jobs:
Release:
# Skip release commits themselves to prevent infinite release loop
if: ${{ !endsWith(github.event.head_commit.message, '[semantic-release]') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- uses: actions/setup-node@v4
with:
node-version-file: .node-version
- uses: actions/cache@v4
id: cache-node_modules
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
- if: steps.cache-node_modules.outputs.cache-hit != 'true'
run: npm ci
- run: npx semantic-release
env:
GH_TOKEN: ${{ secrets.SEMANTIC_RELEASE_TOKEN }}
GIT_AUTHOR_NAME: ${{ github.event.head_commit.author.name }}
GIT_AUTHOR_EMAIL: ${{ github.event.head_commit.author.email }}
GIT_GIT_COMMITTER_NAME_NAME: ${{ github.event.head_commit.committer.name }}
GIT_GIT_COMMITTER_NAME_EMAIL: ${{ github.event.head_commit.committer.email }}