mirror of
https://github.com/bitwarden/self-host.git
synced 2026-06-28 14:25:45 +00:00
105 lines
3.6 KiB
YAML
105 lines
3.6 KiB
YAML
---
|
|
name: Update Versions
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs: {}
|
|
|
|
jobs:
|
|
setup:
|
|
name: Setup
|
|
runs-on: ubuntu-20.04
|
|
outputs:
|
|
core_version: ${{ steps.get-core.outputs.version }}
|
|
web_version: ${{ steps.get-web.outputs.version }}
|
|
key_connector_version: ${{ steps.get-key-connector.outputs.version }}
|
|
steps:
|
|
- name: Get Latest Core Version
|
|
id: get-core
|
|
uses: bitwarden/gh-actions/get-release-version@f0108b4b74486a99918c7c3f7096a584eb8ccf2c
|
|
with:
|
|
repository: bitwarden/server
|
|
|
|
- name: Get Latest Web Version
|
|
id: get-web
|
|
uses: bitwarden/gh-actions/get-release-version@f0108b4b74486a99918c7c3f7096a584eb8ccf2c
|
|
with:
|
|
repository: bitwarden/web
|
|
|
|
- name: Get Latest Key Connector Version
|
|
id: get-key-connector
|
|
uses: bitwarden/gh-actions/get-release-version@f0108b4b74486a99918c7c3f7096a584eb8ccf2c
|
|
with:
|
|
repository: bitwarden/key-connector
|
|
|
|
|
|
update-versions:
|
|
name: "Create update_versions branch"
|
|
runs-on: ubuntu-20.04
|
|
needs: setup
|
|
steps:
|
|
- name: Checkout Branch
|
|
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
|
|
|
|
- name: Create Update Versions Branch
|
|
run: |
|
|
git switch -c update-versions
|
|
git push -u origin update-versions
|
|
|
|
- name: Checkout Update Versions Branch
|
|
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
|
|
with:
|
|
ref: update-versions
|
|
|
|
- name: Update Core Version
|
|
env:
|
|
VERSION: ${{ needs.setup.outputs.core_version }}
|
|
run: |
|
|
sed -i -e "/^\s*COREVERSION\s*=\s*/s/[0-9]\+.[0-9]\+.[0-9]\+/$VERSION/" bitwarden.sh
|
|
sed -i -e "/^\s*\$coreVersion\s*=\s*/s/[0-9]\+.[0-9]\+.[0-9]\+/$VERSION/" bitwarden.ps1
|
|
|
|
- name: Update Web Version
|
|
env:
|
|
VERSION: ${{ needs.setup.outputs.web_version }}
|
|
run: |
|
|
sed -i -e "/^\s*WEBVERSION\s*=\s*/s/[0-9]\+.[0-9]\+.[0-9]\+/$VERSION/" bitwarden.sh
|
|
sed -i -e "/^\s*\$webVersion\s*=\s*/s/[0-9]\+.[0-9]\+.[0-9]\+/$VERSION/" bitwarden.ps1
|
|
|
|
- name: Update Key Connector Version
|
|
env:
|
|
VERSION: ${{ needs.setup.outputs.key_connector_version }}
|
|
run: |
|
|
sed -i -e "/^\s*KEYCONNECTORVERSION\s*=\s*/s/[0-9]\+.[0-9]\+.[0-9]\+/$VERSION/" bitwarden.sh
|
|
sed -i -e "/^\s*\$keyConnectorVersion\s*=\s*/s/[0-9]\+.[0-9]\+.[0-9]\+/$VERSION/" bitwarden.ps1
|
|
|
|
- name: Commit updated files
|
|
run: |
|
|
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
git config --local user.name "github-actions[bot]"
|
|
git commit -m "Updated core, web, and key-connector versions" -a
|
|
|
|
- name: Push changes
|
|
run: git push -u origin update-versions
|
|
|
|
- name: Create Update Versions PR
|
|
env:
|
|
PR_BRANCH: "update-versions"
|
|
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
|
BASE_BRANCH: master
|
|
TITLE: "Update core, web, and key-connector versions"
|
|
run: |
|
|
gh pr create --title "$TITLE" \
|
|
--base "$BASE" \
|
|
--head "$PR_BRANCH" \
|
|
--label "automated pr" \
|
|
--body "
|
|
## Type of change
|
|
- [ ] Bug fix
|
|
- [ ] New feature development
|
|
- [ ] Tech debt (refactoring, code cleanup, dependency upgrades, etc)
|
|
- [ ] Build/deploy pipeline (DevOps)
|
|
- [X] Other
|
|
|
|
## Objective
|
|
Automated version updates to core, web, and key-connector versions in `bitwarden.sh` and `bitwarden.ps1`."
|