2024-02-09 11:29:47 +01:00
|
|
|
name: Auto Bump Desktop Version
|
2022-07-29 12:18:47 +02:00
|
|
|
|
|
|
|
on:
|
2022-10-17 11:50:54 +02:00
|
|
|
push:
|
|
|
|
tags:
|
|
|
|
- desktop-v**
|
2022-07-29 12:18:47 +02:00
|
|
|
|
2022-08-02 00:51:34 +02:00
|
|
|
jobs:
|
2024-02-09 11:29:47 +01:00
|
|
|
bump-version:
|
|
|
|
name: Bump Desktop Version
|
2024-11-05 17:48:03 +01:00
|
|
|
runs-on: ubuntu-24.04
|
2022-07-29 12:18:47 +02:00
|
|
|
steps:
|
2024-11-05 17:48:03 +01:00
|
|
|
- name: Generate GH App token
|
|
|
|
uses: actions/create-github-app-token@5d869da34e18e7287c1daad50e0b8ea0f506ce69 # v1.11.0
|
|
|
|
id: app-token
|
2024-02-09 11:29:47 +01:00
|
|
|
with:
|
2024-11-05 17:48:03 +01:00
|
|
|
app-id: ${{ secrets.BW_GHAPP_ID }}
|
|
|
|
private-key: ${{ secrets.BW_GHAPP_KEY }}
|
2024-02-09 11:29:47 +01:00
|
|
|
|
2024-11-05 17:48:03 +01:00
|
|
|
- name: Check out target ref
|
|
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
2024-02-09 11:29:47 +01:00
|
|
|
with:
|
2024-11-05 17:48:03 +01:00
|
|
|
ref: main
|
|
|
|
token: ${{ steps.app-token.outputs.token }}
|
2024-02-09 11:29:47 +01:00
|
|
|
|
2024-11-05 17:48:03 +01:00
|
|
|
- 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
|
2024-02-09 11:29:47 +01:00
|
|
|
run: |
|
2024-11-05 17:48:03 +01:00
|
|
|
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
|