1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-06 00:13:28 +00:00

[PM-25911] Add commercial sdk internal as dependency (#16883)

* feat: add commercial sdk as optional dependency

* feat: add alias to CLI

* feat: add alias to browser

* feat: add alias to web

* fix: revert optional - we cant omit optional dependencies or the builds break

* feat: remove commercial package from browser build

* feat: remove commercial package from cli build

* feat: remove commercial package from web build

* chore: add commercial sdk to renovate

* fix: windows cli workflow

* fix: accidental change

* feat: add lint for version string

* undo weird merge changes
This commit is contained in:
Andreas Coroiu
2025-10-27 15:17:20 +01:00
committed by GitHub
parent abc6e54bb9
commit 64590cb3c8
16 changed files with 139 additions and 6 deletions

View File

@@ -139,6 +139,7 @@
"@babel/core",
"@babel/preset-env",
"@bitwarden/sdk-internal",
"@bitwarden/commercial-sdk-internal",
"@electron/fuses",
"@electron/notarize",
"@electron/rebuild",

View File

@@ -219,12 +219,14 @@ jobs:
archive_name_prefix: ""
npm_command_prefix: "dist:"
readable: "open source license"
type: "oss"
- build_prefix: "bit-"
artifact_prefix: "bit-"
source_archive_name_prefix: "bit-"
archive_name_prefix: "bit-"
npm_command_prefix: "dist:bit:"
readable: "commercial license"
type: "commercial"
browser:
- name: "chrome"
npm_command_suffix: "chrome"
@@ -279,6 +281,11 @@ jobs:
run: npm ci
working-directory: browser-source/
- name: Remove commercial packages
if: ${{ matrix.license_type.type == 'oss' }}
run: rm -rf node_modules/@bitwarden/commercial-sdk-internal
working-directory: browser-source/
- name: Download SDK artifacts
if: ${{ inputs.sdk_branch != '' }}
uses: bitwarden/gh-actions/download-artifacts@main
@@ -350,11 +357,13 @@ jobs:
archive_name_prefix: ""
npm_command_prefix: "dist:"
readable: "open source license"
type: "oss"
- build_prefix: "bit-"
artifact_prefix: "bit-"
archive_name_prefix: "bit-"
npm_command_prefix: "dist:bit:"
readable: "commercial license"
type: "commercial"
env:
_BUILD_NUMBER: ${{ needs.setup.outputs.adj_build_number }}
_NODE_VERSION: ${{ needs.setup.outputs.node_version }}
@@ -461,6 +470,11 @@ jobs:
run: npm ci
working-directory: ./
- name: Remove commercial packages
if: ${{ matrix.license_type.type == 'oss' }}
run: rm -rf node_modules/@bitwarden/commercial-sdk-internal
working-directory: ./
- name: Download SDK Artifacts
if: ${{ inputs.sdk_branch != '' }}
uses: bitwarden/gh-actions/download-artifacts@main

View File

@@ -98,8 +98,8 @@ jobs:
]
license_type:
[
{ build_prefix: "oss", artifact_prefix: "-oss", readable: "open source license" },
{ build_prefix: "bit", artifact_prefix: "", readable: "commercial license" }
{ type: "oss", build_prefix: "oss", artifact_prefix: "-oss", readable: "open source license" },
{ type: "commercial", build_prefix: "bit", artifact_prefix: "", readable: "commercial license" }
]
runs-on: ${{ matrix.os.distro }}
needs: setup
@@ -140,6 +140,11 @@ jobs:
run: npm ci
working-directory: ./
- name: Remove commercial packages
if: ${{ matrix.license_type.type == 'oss' }}
run: rm -rf node_modules/@bitwarden/commercial-sdk-internal
working-directory: ./
- name: Download SDK Artifacts
if: ${{ inputs.sdk_branch != '' && needs.setup.outputs.has_secrets == 'true' }}
uses: bitwarden/gh-actions/download-artifacts@main
@@ -291,8 +296,8 @@ jobs:
matrix:
license_type:
[
{ build_prefix: "oss", artifact_prefix: "-oss", readable: "open source license" },
{ build_prefix: "bit", artifact_prefix: "", readable: "commercial license" }
{ type: "oss", build_prefix: "oss", artifact_prefix: "-oss", readable: "open source license" },
{ type: "commercial", build_prefix: "bit", artifact_prefix: "", readable: "commercial license" }
]
runs-on: windows-2022
permissions:
@@ -410,6 +415,11 @@ jobs:
run: npm ci
working-directory: ./
- name: Remove commercial packages
if: ${{ matrix.license_type.type == 'oss' }}
run: Remove-Item -Recurse -Force -ErrorAction SilentlyContinue "node_modules/@bitwarden/commercial-sdk-internal"
working-directory: ./
- name: Download SDK Artifacts
if: ${{ inputs.sdk_branch != '' && needs.setup.outputs.has_secrets == 'true' }}
uses: bitwarden/gh-actions/download-artifacts@main

View File

@@ -99,34 +99,43 @@ jobs:
matrix:
include:
- artifact_name: selfhosted-open-source
license_type: "oss"
image_name: web-oss
npm_command: dist:oss:selfhost
- artifact_name: cloud-COMMERCIAL
license_type: "commercial"
image_name: web-cloud
npm_command: dist:bit:cloud
- artifact_name: selfhosted-COMMERCIAL
license_type: "commercial"
image_name: web
npm_command: dist:bit:selfhost
- artifact_name: selfhosted-DEV
license_type: "commercial"
image_name: web
npm_command: build:bit:selfhost:dev
git_metadata: true
- artifact_name: cloud-QA
license_type: "commercial"
image_name: web-qa-cloud
npm_command: build:bit:qa
git_metadata: true
- artifact_name: ee
license_type: "commercial"
image_name: web-ee
npm_command: build:bit:ee
git_metadata: true
- artifact_name: cloud-euprd
license_type: "commercial"
image_name: web-euprd
npm_command: build:bit:euprd
- artifact_name: cloud-euqa
license_type: "commercial"
image_name: web-euqa
npm_command: build:bit:euqa
git_metadata: true
- artifact_name: cloud-usdev
license_type: "commercial"
image_name: web-usdev
npm_command: build:bit:usdev
git_metadata: true
@@ -269,6 +278,7 @@ jobs:
build-args: |
NODE_VERSION=${{ env._NODE_VERSION }}
NPM_COMMAND=${{ matrix.npm_command }}
LICENSE_TYPE=${{ matrix.license_type }}
context: .
file: apps/web/Dockerfile
load: true

View File

@@ -75,6 +75,9 @@ jobs:
- name: Lint unowned dependencies
run: npm run lint:dep-ownership
- name: Lint sdk-internal versions
run: npm run lint:sdk-internal-versions
- name: Run linter
run: npm run lint