-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
92 lines (79 loc) · 2.55 KB
/
action.yml
File metadata and controls
92 lines (79 loc) · 2.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: "Setup NodeJS Environment"
description: "Installs NodeJS, checks out, installs dependencies"
inputs:
token:
description: "Github personal access token"
required: true
fetch-depth:
description: 'Number of commits to fetch. 0 indicates all history for all branches and tags.'
default: "1"
node-version:
description: "NodeJS version"
required: false
default: "lts/*"
cache:
description: "Enable or disable caching"
required: false
default: "true"
cache-key:
description: "Unique cache key"
required: false
default: ""
install-deps:
description: "Install dependencies"
required: false
default: "true"
github-registries:
description: "Private github registry names (comma separated)"
required: false
runs:
using: "composite"
steps:
- uses: actions/checkout@v6
with:
fetch-depth: ${{ inputs.fetch-depth }}
- uses: actions/setup-node@v6
with:
node-version: ${{ inputs.node-version }}
- name: Display versions
if: ${{ inputs.install-deps == 'true' }}
run: |
echo -e "\033[36mNodeJS version: \033[39m $(node -v)"
node -v
echo -e "\033[36mNpm version: \033[39m $(npm -v)"
npm -v
shell: bash
- name: Create .npmrc File for Github Packages
if: ${{ inputs.github-registries }}
run: |
NPMRC_FILE="$GITHUB_WORKSPACE/.npmrc"
echo "NPMRC_FILE=$NPMRC_FILE" >> $GITHUB_ENV
# Process comma seperated Virgülle ayrılmış registry isimlerini işle
IFS=',' read -ra REGISTRIES <<< "${{ inputs.github-registries }}"
for registry in "${REGISTRIES[@]}"; do
# Boşlukları temizle
registry=$(echo "$registry" | xargs)
if [ ! -z "$registry" ]; then
echo "@${registry}:registry=https://npm.pkg.github.com" >> "$NPMRC_FILE"
fi
done
# Add Auth token
echo "//npm.pkg.github.com/:_authToken=${{ inputs.token }}" >> "$NPMRC_FILE"
shell: bash
- name: Cache Node Modules
if: ${{ inputs.cache == 'true' }}
uses: actions/cache@v5
with:
path: ${{ github.workspace }}/node_modules
key: ${{ runner.os }}-node-modules-${{ inputs.cache-key }}-${{ hashFiles('**/package-lock.json') }}
- name: Install dependencies
if: ${{ inputs.install-deps == 'true' }}
run: |
rm -f package-lock.json
npm install --no-save
npm i rman -g
shell: bash
- name: Install rman
run: |
npm i rman -g
shell: bash