Browse Source

[BRE-1424] Pass in the GH tag to use for building BW lite

pull/443/head
Andy Pixley 5 days ago
parent
commit
296b38d712
No known key found for this signature in database
GPG Key ID: 4025C92FEDF5ED81
  1. 10
      .github/workflows/build-bitwarden-lite.yml
  2. 13
      .github/workflows/release.yml

10
.github/workflows/build-bitwarden-lite.yml

@ -7,6 +7,10 @@ on:
- ".github/workflows/build-bitwarden-lite.yml" - ".github/workflows/build-bitwarden-lite.yml"
workflow_dispatch: workflow_dispatch:
inputs: inputs:
repo_ref:
description: "Self-host ref to use for checkout (Default: current ref)"
type: string
required: false
server_branch: server_branch:
description: "Server branch name (examples: 'main', 'rc', 'feature/sm')" description: "Server branch name (examples: 'main', 'rc', 'feature/sm')"
type: string type: string
@ -25,6 +29,10 @@ on:
default: false default: false
workflow_call: workflow_call:
inputs: inputs:
repo_ref:
description: "Self-host ref to use for checkout (Default: current ref)"
type: string
required: false
server_branch: server_branch:
description: "Server branch name (examples: 'main', 'rc', 'feature/sm')" description: "Server branch name (examples: 'main', 'rc', 'feature/sm')"
type: string type: string
@ -64,6 +72,7 @@ jobs:
- name: Checkout Repository - name: Checkout Repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with: with:
ref: ${{ inputs.repo_ref || github.ref }}
persist-credentials: false persist-credentials: false
- name: Set Server variables - name: Set Server variables
@ -113,6 +122,7 @@ jobs:
- name: Checkout Repository - name: Checkout Repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with: with:
ref: ${{ inputs.repo_ref || github.ref }}
persist-credentials: false persist-credentials: false
- name: Set up QEMU emulators - name: Set up QEMU emulators

13
.github/workflows/release.yml

@ -87,7 +87,7 @@ jobs:
app-id: ${{ steps.get-kv-secrets.outputs.BW-GHAPP-ID }} app-id: ${{ steps.get-kv-secrets.outputs.BW-GHAPP-ID }}
private-key: ${{ steps.get-kv-secrets.outputs.BW-GHAPP-KEY }} private-key: ${{ steps.get-kv-secrets.outputs.BW-GHAPP-KEY }}
permission-contents: write # for pushing commits permission-contents: write # for pushing commits
- name: Checkout Branch - name: Checkout Branch
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with: with:
@ -102,13 +102,13 @@ jobs:
repository: bitwarden/server repository: bitwarden/server
trim: true trim: true
- name: Update Core version - name: Update Core version
id: update-core-version id: update-core-version
env: env:
NEW_VERSION: ${{ steps.get-core.outputs.version }} NEW_VERSION: ${{ steps.get-core.outputs.version }}
run: | run: |
OLD_VERSION=$(jq -r '.versions.coreVersion' version.json) OLD_VERSION=$(jq -r '.versions.coreVersion' version.json)
sed -i -e "/^\s*COREVERSION\s*=\s*/s/[0-9]\+.[0-9]\+.[0-9]\+/$NEW_VERSION/" bitwarden.sh sed -i -e "/^\s*COREVERSION\s*=\s*/s/[0-9]\+.[0-9]\+.[0-9]\+/$NEW_VERSION/" bitwarden.sh
sed -i -e "/^\s*\$coreVersion\s*=\s*/s/[0-9]\+.[0-9]\+.[0-9]\+/$NEW_VERSION/" bitwarden.ps1 sed -i -e "/^\s*\$coreVersion\s*=\s*/s/[0-9]\+.[0-9]\+.[0-9]\+/$NEW_VERSION/" bitwarden.ps1
sed -i -e '/"coreVersion":/ s/"coreVersion":[^,]*/"coreVersion":"'$NEW_VERSION'"/' version.json sed -i -e '/"coreVersion":/ s/"coreVersion":[^,]*/"coreVersion":"'$NEW_VERSION'"/' version.json
@ -417,13 +417,16 @@ jobs:
build-lite-image: build-lite-image:
name: Build Bitwarden lite image name: Build Bitwarden lite image
uses: ./.github/workflows/build-bitwarden-lite.yml uses: ./.github/workflows/build-bitwarden-lite.yml
needs: update-versions needs:
- update-versions
- release-github
permissions: permissions:
contents: read contents: read
id-token: write id-token: write
packages: write packages: write
security-events: write security-events: write
with: with:
repo_ref: "v${{ inputs.release_version }}"
use_latest_core_version: true use_latest_core_version: true
use_latest_web_version: true use_latest_web_version: true
secrets: inherit secrets: inherit
@ -576,6 +579,6 @@ jobs:
owner: 'bitwarden', owner: 'bitwarden',
repo: 'self-host', repo: 'self-host',
workflow_id: 'release-digital-ocean.yml', workflow_id: 'release-digital-ocean.yml',
ref: 'main', ref: 'v${{ inputs.release_version_}}',
inputs: {} inputs: {}
}); });

Loading…
Cancel
Save