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

[PM-31831] fix: add support for overriding commercial SDK (#18863)

* fix: add support for overriding commercial SDK

* fix: only download commercial when needed

* fix: only download OSS SDK for OSS builds and commercial SDK for commercial builds

Previously, the OSS sdk-internal was downloaded and linked for all
build types including commercial, which is wasteful. Now each build
type only downloads the SDK artifact it needs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* revert: changes to build-desktop.yml

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Andreas Coroiu
2026-02-25 11:15:19 +01:00
committed by GitHub
parent 98f6169333
commit a5df3540af
4 changed files with 108 additions and 15 deletions

View File

@@ -146,7 +146,7 @@ jobs:
working-directory: ./
- name: Download SDK Artifacts
if: ${{ inputs.sdk_branch != '' && needs.setup.outputs.has_secrets == 'true' }}
if: ${{ inputs.sdk_branch != '' && needs.setup.outputs.has_secrets == 'true' && matrix.license_type.type != 'commercial' }}
uses: bitwarden/gh-actions/download-artifacts@main
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
@@ -159,12 +159,31 @@ jobs:
if_no_artifact_found: fail
- name: Override SDK
if: ${{ inputs.sdk_branch != '' && needs.setup.outputs.has_secrets == 'true' }}
if: ${{ inputs.sdk_branch != '' && needs.setup.outputs.has_secrets == 'true' && matrix.license_type.type != 'commercial' }}
working-directory: ./
run: |
ls -l ../
npm link ../sdk-internal
- name: Download Commercial SDK Artifacts
if: ${{ inputs.sdk_branch != '' && needs.setup.outputs.has_secrets == 'true' && matrix.license_type.type == 'commercial' }}
uses: bitwarden/gh-actions/download-artifacts@main
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
workflow: build-wasm-internal.yml
workflow_conclusion: success
branch: ${{ inputs.sdk_branch }}
artifacts: commercial-sdk-internal
repo: bitwarden/sdk-internal
path: ../commercial-sdk-internal
if_no_artifact_found: fail
- name: Override Commercial SDK
if: ${{ inputs.sdk_branch != '' && needs.setup.outputs.has_secrets == 'true' && matrix.license_type.type == 'commercial' }}
working-directory: ./
run: |
npm link ../commercial-sdk-internal
- name: Build & Package Unix
env:
_SHORT_RUNNER_OS: ${{ env.SHORT_RUNNER_OS }}
@@ -421,7 +440,7 @@ jobs:
working-directory: ./
- name: Download SDK Artifacts
if: ${{ inputs.sdk_branch != '' && needs.setup.outputs.has_secrets == 'true' }}
if: ${{ inputs.sdk_branch != '' && needs.setup.outputs.has_secrets == 'true' && matrix.license_type.type != 'commercial' }}
uses: bitwarden/gh-actions/download-artifacts@main
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
@@ -434,12 +453,31 @@ jobs:
if_no_artifact_found: fail
- name: Override SDK
if: ${{ inputs.sdk_branch != '' && needs.setup.outputs.has_secrets == 'true' }}
if: ${{ inputs.sdk_branch != '' && needs.setup.outputs.has_secrets == 'true' && matrix.license_type.type != 'commercial' }}
working-directory: ./
run: |
ls -l ../
npm link ../sdk-internal
- name: Download Commercial SDK Artifacts
if: ${{ inputs.sdk_branch != '' && needs.setup.outputs.has_secrets == 'true' && matrix.license_type.type == 'commercial' }}
uses: bitwarden/gh-actions/download-artifacts@main
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
workflow: build-wasm-internal.yml
workflow_conclusion: success
branch: ${{ inputs.sdk_branch }}
artifacts: commercial-sdk-internal
repo: bitwarden/sdk-internal
path: ../commercial-sdk-internal
if_no_artifact_found: fail
- name: Override Commercial SDK
if: ${{ inputs.sdk_branch != '' && needs.setup.outputs.has_secrets == 'true' && matrix.license_type.type == 'commercial' }}
working-directory: ./
run: |
npm link ../commercial-sdk-internal
- name: Build & Package Windows
run: npm run dist:${{ matrix.license_type.build_prefix }}:win --quiet