mirror of
https://github.com/bitwarden/browser
synced 2025-12-06 00:13:28 +00:00
85 lines
2.8 KiB
YAML
85 lines
2.8 KiB
YAML
name: Auto Bump Desktop Version
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- desktop-v**
|
|
|
|
jobs:
|
|
bump-version:
|
|
name: Bump Desktop Version
|
|
runs-on: ubuntu-24.04
|
|
permissions:
|
|
id-token: write
|
|
contents: write
|
|
steps:
|
|
- name: Log in to Azure
|
|
uses: bitwarden/gh-actions/azure-login@main
|
|
with:
|
|
subscription_id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
|
|
tenant_id: ${{ secrets.AZURE_TENANT_ID }}
|
|
client_id: ${{ secrets.AZURE_CLIENT_ID }}
|
|
|
|
- name: Get Azure Key Vault secrets
|
|
id: get-kv-secrets
|
|
uses: bitwarden/gh-actions/get-keyvault-secrets@main
|
|
with:
|
|
keyvault: gh-org-bitwarden
|
|
secrets: "BW-GHAPP-ID,BW-GHAPP-KEY"
|
|
|
|
- name: Log out from Azure
|
|
uses: bitwarden/gh-actions/azure-logout@main
|
|
|
|
- name: Generate GH App token
|
|
uses: actions/create-github-app-token@67018539274d69449ef7c02e8e71183d1719ab42 # v2.1.4
|
|
id: app-token
|
|
with:
|
|
app-id: ${{ steps.get-kv-secrets.outputs.BW-GHAPP-ID }}
|
|
private-key: ${{ steps.get-kv-secrets.outputs.BW-GHAPP-KEY }}
|
|
permission-contents: write # for committing and pushing to the current branch
|
|
|
|
- name: Check out target ref
|
|
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
|
|
with:
|
|
ref: main
|
|
token: ${{ steps.app-token.outputs.token }}
|
|
persist-credentials: true
|
|
|
|
- name: Configure Git
|
|
run: |
|
|
git config --local user.email "actions@github.com"
|
|
git config --local user.name "Github Actions"
|
|
|
|
- name: Get current Desktop version
|
|
id: current-desktop-version
|
|
run: |
|
|
CURRENT_VERSION=$(cat package.json | jq -r '.version')
|
|
echo "version=$CURRENT_VERSION" >> "$GITHUB_OUTPUT"
|
|
working-directory: apps/desktop
|
|
|
|
- name: Calculate next Desktop release version
|
|
id: calculate-next-desktop-version
|
|
uses: bitwarden/gh-actions/version-next@main
|
|
with:
|
|
version: ${{ steps.current-desktop-version.outputs.version }}
|
|
|
|
- name: Bump Desktop Version - Root - Automatic Calculation
|
|
id: bump-desktop-version-automatic
|
|
env:
|
|
VERSION: ${{ steps.calculate-next-desktop-version.outputs.version }}
|
|
run: npm version --workspace=@bitwarden/desktop "$VERSION"
|
|
|
|
- name: Bump Desktop Version - App - Automatic Calculation
|
|
env:
|
|
VERSION: ${{ steps.calculate-next-desktop-version.outputs.version }}
|
|
run: npm version "$VERSION"
|
|
working-directory: "apps/desktop/src"
|
|
|
|
- name: Commit files
|
|
env:
|
|
VERSION: ${{ steps.calculate-next-desktop-version.outputs.version }}
|
|
run: git commit -m "Bumped Desktop client to $VERSION" -a
|
|
|
|
- name: Push changes
|
|
run: git push
|