1
0
mirror of https://github.com/bitwarden/directory-connector synced 2026-02-28 10:13:15 +00:00
This commit is contained in:
Brandon
2026-02-18 15:13:21 -05:00
parent 1fd8bf318f
commit 83ef9888e6
4 changed files with 72 additions and 88 deletions

View File

@@ -0,0 +1,44 @@
name: Setup Node Environment
description: Common setup steps for Node.js environment including checkout, Node setup with npm caching, and node-gyp installation
inputs:
node-version:
description: Node.js version to install
required: true
persist-credentials:
description: Whether to persist git credentials
required: false
default: "false"
platform:
description: Platform name for shell selection (Linux, macOS, Windows)
required: false
default: Linux
runs:
using: composite
steps:
- name: Checkout repo
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: ${{ inputs.persist-credentials }}
- name: Set up Node
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
cache: "npm"
cache-dependency-path: "**/package-lock.json"
node-version: ${{ inputs.node-version }}
- name: Update NPM and install node-gyp (Unix)
if: inputs.platform != 'Windows'
shell: bash
run: |
npm install -g npm@latest node-gyp
node-gyp install "$(node -v)"
- name: Update NPM and install node-gyp (Windows)
if: inputs.platform == 'Windows'
shell: pwsh
run: |
npm install -g npm@latest node-gyp
node-gyp install $(node -v)

View File

@@ -50,22 +50,12 @@ jobs:
permissions:
contents: read
steps:
- name: Checkout repo
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup Node Environment
uses: ./.github/actions/setup-node-env
with:
persist-credentials: false
- name: Set up Node
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
node-version: ${{ env._NODE_VERSION }}
- name: Update NPM
run: |
npm install -g node-gyp
node-gyp install "$(node -v)"
persist-credentials: false
platform: Linux
- name: Keytar
run: |
@@ -128,22 +118,12 @@ jobs:
_PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }}
_NODE_VERSION: ${{ needs.setup.outputs.node_version }}
steps:
- name: Checkout repo
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup Node Environment
uses: ./.github/actions/setup-node-env
with:
persist-credentials: false
- name: Set up Node
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
node-version: ${{ env._NODE_VERSION }}
- name: Update NPM
run: |
npm install -g node-gyp
node-gyp install "$(node -v)"
persist-credentials: false
platform: macOS
- name: Keytar
run: |
@@ -199,26 +179,16 @@ jobs:
_PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }}
_NODE_VERSION: ${{ needs.setup.outputs.node_version }}
steps:
- name: Checkout repo
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Setup Windows builder
run: |
choco install checksum --no-progress
- name: Set up Node
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
- name: Setup Node Environment
uses: ./.github/actions/setup-node-env
with:
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
node-version: ${{ env._NODE_VERSION }}
- name: Update NPM
run: |
npm install -g node-gyp
node-gyp install $(node -v)
persist-credentials: false
platform: Windows
- name: Keytar
shell: pwsh
@@ -243,8 +213,8 @@ jobs:
run: npm run dist:cli:win
- name: Zip
shell: cmd
run: 7z a .\dist-cli\bwdc-windows-%_PACKAGE_VERSION%.zip .\dist-cli\windows\bwdc.exe .\keytar\windows\keytar.node
shell: pwsh
run: 7z a .\dist-cli\bwdc-windows-$env:_PACKAGE_VERSION.zip .\dist-cli\windows\bwdc.exe .\keytar\windows\keytar.node
- name: Version Test
shell: pwsh
@@ -278,22 +248,12 @@ jobs:
_NODE_VERSION: ${{ needs.setup.outputs.node_version }}
HUSKY: 0
steps:
- name: Checkout repo
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup Node Environment
uses: ./.github/actions/setup-node-env
with:
persist-credentials: false
- name: Set up Node
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
node-version: ${{ env._NODE_VERSION }}
- name: Update NPM
run: |
npm install -g node-gyp
node-gyp install $(node -v)
persist-credentials: false
platform: Windows
- name: Print environment
run: |
@@ -378,22 +338,12 @@ jobs:
_NODE_VERSION: ${{ needs.setup.outputs.node_version }}
HUSKY: 0
steps:
- name: Checkout repo
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup Node Environment
uses: ./.github/actions/setup-node-env
with:
persist-credentials: false
- name: Set up Node
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
node-version: ${{ env._NODE_VERSION }}
- name: Update NPM
run: |
npm install -g node-gyp
node-gyp install "$(node -v)"
persist-credentials: false
platform: Linux
- name: Set up environment
run: |
@@ -438,22 +388,12 @@ jobs:
_NODE_VERSION: ${{ needs.setup.outputs.node_version }}
HUSKY: 0
steps:
- name: Checkout repo
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup Node Environment
uses: ./.github/actions/setup-node-env
with:
persist-credentials: false
- name: Set up Node
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
node-version: ${{ env._NODE_VERSION }}
- name: Update NPM
run: |
npm install -g node-gyp
node-gyp install "$(node -v)"
persist-credentials: false
platform: macOS
- name: Print environment
run: |

2
.nvmrc
View File

@@ -1 +1 @@
v20
v22

View File

@@ -177,7 +177,7 @@
"zone.js": "0.16.0"
},
"engines": {
"node": "~20",
"node": "~22",
"npm": "~10"
},
"lint-staged": {