1
0
mirror of https://github.com/bitwarden/browser synced 2026-01-30 16:23:53 +00:00

pnpm workflows

This commit is contained in:
Anders Åberg
2025-12-15 22:32:37 +01:00
parent 422f94a8c5
commit 40a8a084bc
5 changed files with 33363 additions and 37 deletions

View File

@@ -151,18 +151,6 @@ jobs:
ref: ${{ github.event.pull_request.head.sha }}
persist-credentials: false
- name: Set up Node
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
with:
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
node-version: ${{ env._NODE_VERSION }}
- name: Print environment
run: |
node --version
npm --version
- name: Build sources for reviewers
run: |
# Include hidden files in glob copy
@@ -259,17 +247,21 @@ jobs:
ref: ${{ github.event.pull_request.head.sha }}
persist-credentials: false
- name: Set up pnpm
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
with:
version: 10
- name: Set up Node
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
with:
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
cache: 'pnpm'
node-version: ${{ env._NODE_VERSION }}
- name: Print environment
run: |
node --version
npm --version
pnpm --version
- name: Download browser source
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
@@ -281,8 +273,8 @@ jobs:
unzip browser-source.zip
rm browser-source.zip
- name: NPM setup
run: npm ci
- name: Install dependencies
run: pnpm install --frozen-lockfile
working-directory: browser-source/
- name: Remove commercial packages
@@ -306,7 +298,7 @@ jobs:
- name: Override SDK
if: ${{ inputs.sdk_branch != '' }}
working-directory: browser-source/
run: npm link ../sdk-internal
run: pnpm link ../sdk-internal
- name: Check source file size
if: ${{ startsWith(matrix.browser.name, 'firefox') }}
@@ -332,7 +324,7 @@ jobs:
fi
- name: Build extension
run: npm run ${{matrix.license_type.npm_command_prefix}}${{ matrix.browser.npm_command_suffix }}
run: pnpm run ${{matrix.license_type.npm_command_prefix}}${{ matrix.browser.npm_command_suffix }}
working-directory: browser-source/apps/browser
- name: Upload extension artifact
@@ -344,7 +336,7 @@ jobs:
- name: Package dev extension
if: ${{ matrix.browser.archive_name_dev != '' }}
run: npm run ${{ matrix.license_type.npm_package_dev_prefix }}${{ matrix.browser.npm_command_suffix }}
run: pnpm run ${{ matrix.license_type.npm_package_dev_prefix }}${{ matrix.browser.npm_command_suffix }}
working-directory: browser-source/apps/browser
- name: Upload dev extension artifact
@@ -391,17 +383,21 @@ jobs:
ref: ${{ github.event.pull_request.head.sha }}
persist-credentials: false
- name: Set up pnpm
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
with:
version: 10
- name: Set up Node
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
with:
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
cache: 'pnpm'
node-version: ${{ env._NODE_VERSION }}
- name: Print environment
run: |
node --version
npm --version
pnpm --version
- name: Log in to Azure
uses: bitwarden/gh-actions/azure-login@main
@@ -483,8 +479,8 @@ jobs:
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$KEYCHAIN_PASSWORD" build.keychain
- name: NPM setup
run: npm ci
- name: Install dependencies
run: pnpm install --frozen-lockfile
working-directory: ./
- name: Remove commercial packages
@@ -508,11 +504,10 @@ jobs:
- name: Override SDK
if: ${{ inputs.sdk_branch != '' }}
working-directory: ./
run: |
npm link ../sdk-internal
run: pnpm link ../sdk-internal
- name: Build Safari extension
run: npm run ${{matrix.license_type.npm_command_prefix}}safari
run: pnpm run ${{matrix.license_type.npm_command_prefix}}safari
working-directory: apps/browser
- name: Zip Safari build artifact

View File

@@ -63,24 +63,28 @@ jobs:
NODE_VERSION=${NODE_NVMRC/v/''}
echo "node_version=$NODE_VERSION" >> "$GITHUB_OUTPUT"
- name: Set up pnpm
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
with:
version: 10
- name: Set up Node
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
with:
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
cache: 'pnpm'
node-version: ${{ steps.retrieve-node-version.outputs.node_version }}
- name: Install Node dependencies
run: npm ci
run: pnpm install --frozen-lockfile
- name: Lint unowned dependencies
run: npm run lint:dep-ownership
run: pnpm run lint:dep-ownership
- name: Lint sdk-internal versions
run: npm run lint:sdk-internal-versions
run: pnpm run lint:sdk-internal-versions
- name: Run linter
run: npm run lint
run: pnpm run lint
rust:
name: Run Rust lint on ${{ matrix.os }}

View File

@@ -4,10 +4,13 @@
ARG NODE_VERSION=20
FROM --platform=$BUILDPLATFORM node:${NODE_VERSION}-alpine AS node-build
# Enable pnpm via corepack
RUN corepack enable pnpm
WORKDIR /source
COPY package*.json ./
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
COPY . .
RUN npm ci
RUN pnpm install --frozen-lockfile
# Remove commercial packages if LICENSE_TYPE is not 'commercial'
ARG LICENSE_TYPE=oss
@@ -17,7 +20,7 @@ RUN if [ "${LICENSE_TYPE}" != "commercial" ] ; then \
WORKDIR /source/apps/web
ARG NPM_COMMAND=dist:bit:selfhost
RUN npm run ${NPM_COMMAND}
RUN pnpm run ${NPM_COMMAND}
###############################################
# Build stage 2 #

33320
pnpm-lock.yaml generated Normal file

File diff suppressed because it is too large Load Diff

4
pnpm-workspace.yaml Normal file
View File

@@ -0,0 +1,4 @@
packages:
- "apps/*"
- "apps/desktop/desktop_native/napi"
- "libs/**/*"