49 lines
1.5 KiB
YAML
49 lines
1.5 KiB
YAML
name: 'Setup Semantic Release'
|
|
description: 'Setup Node.js and install semantic-release with all necessary plugins'
|
|
author: 'zertus'
|
|
|
|
inputs:
|
|
node-version:
|
|
description: 'Node.js version to setup'
|
|
required: false
|
|
default: '24'
|
|
|
|
runs:
|
|
using: 'composite'
|
|
steps:
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v6
|
|
with:
|
|
node-version: ${{ inputs.node-version }}
|
|
|
|
- name: Cache semantic-release dependencies
|
|
id: cache-semantic-release
|
|
uses: actions/cache@v5
|
|
with:
|
|
path: ${{ github.action_path }}/node_modules
|
|
key: semantic-release-${{ runner.os }}-node${{ inputs.node-version }}-${{ hashFiles(format('{0}/package.json', github.action_path)) }}
|
|
|
|
- name: Install semantic-release dependencies
|
|
if: steps.cache-semantic-release.outputs.cache-hit != 'true'
|
|
shell: bash
|
|
working-directory: ${{ github.action_path }}
|
|
run: |
|
|
set -euo pipefail
|
|
npm ci && npm cache clean --force
|
|
echo "✓ Semantic-release dependencies installed"
|
|
|
|
- name: Add semantic-release to PATH
|
|
shell: bash
|
|
run: |
|
|
set -euo pipefail
|
|
echo "${{ github.action_path }}/node_modules/.bin" >> $GITHUB_PATH
|
|
echo "NODE_PATH=${{ github.action_path }}/node_modules${NODE_PATH:+:$NODE_PATH}" >> $GITHUB_ENV
|
|
if [ ! -e "${{ github.workspace }}/node_modules" ]; then
|
|
ln -s "${{ github.action_path }}/node_modules" "${{ github.workspace }}/node_modules"
|
|
fi
|
|
echo "✓ Semantic-release added to PATH"
|
|
|
|
branding:
|
|
icon: 'tag'
|
|
color: 'purple'
|