2022-08-02 09:34:07 +02:00
|
|
|
---
|
2024-02-12 13:56:08 +01:00
|
|
|
name: Auto Bump Mobile Version
|
2022-07-29 12:18:57 +02:00
|
|
|
|
|
|
|
on:
|
2022-10-17 11:50:38 +02:00
|
|
|
push:
|
|
|
|
tags:
|
|
|
|
- v**
|
2022-07-29 12:18:57 +02:00
|
|
|
|
|
|
|
jobs:
|
2024-02-12 13:56:08 +01:00
|
|
|
bump-version:
|
|
|
|
name: Bump Mobile Version
|
2022-10-11 16:27:07 +02:00
|
|
|
runs-on: ubuntu-22.04
|
2022-07-29 12:18:57 +02:00
|
|
|
steps:
|
2022-08-02 09:34:07 +02:00
|
|
|
- name: Checkout Branch
|
2024-02-12 13:56:08 +01:00
|
|
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
2022-08-02 09:34:07 +02:00
|
|
|
|
2022-10-11 16:27:07 +02:00
|
|
|
- name: Calculate bumped version
|
2022-08-02 09:34:07 +02:00
|
|
|
id: version
|
|
|
|
env:
|
2022-10-17 11:50:38 +02:00
|
|
|
RELEASE_TAG: ${{ github.ref }}
|
2022-08-02 09:34:07 +02:00
|
|
|
run: |
|
2023-01-16 18:45:23 +01:00
|
|
|
CURR_MAJOR=$(echo $RELEASE_TAG | sed -r 's/refs\/tags\/v([0-9]{4}\.[0-9]{1,2})\.([0-9]{1,2})/\1/')
|
|
|
|
CURR_PATCH=$(echo $RELEASE_TAG | sed -r 's/refs\/tags\/v([0-9]{4}\.[0-9]{1,2})\.([0-9]{1,2})/\2/')
|
2022-10-17 11:50:38 +02:00
|
|
|
echo "Current Major: $CURR_MAJOR"
|
2022-10-11 16:27:07 +02:00
|
|
|
echo "Current Patch: $CURR_PATCH"
|
2022-08-02 09:34:07 +02:00
|
|
|
|
2022-10-17 11:50:38 +02:00
|
|
|
NEW_PATCH=$((CURR_PATCH+1))
|
2022-10-11 16:27:07 +02:00
|
|
|
NEW_VER=$CURR_MAJOR.$NEW_PATCH
|
|
|
|
echo "New Version: $NEW_VER"
|
2024-02-12 13:56:08 +01:00
|
|
|
echo "new_version=$NEW_VER" >> $GITHUB_OUTPUT
|
2022-08-02 09:34:07 +02:00
|
|
|
|
2024-02-12 13:56:08 +01:00
|
|
|
- name: Login to Azure - CI Subscription
|
|
|
|
uses: Azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # v1.6.0
|
|
|
|
with:
|
|
|
|
creds: ${{ secrets.AZURE_KV_CI_SERVICE_PRINCIPAL }}
|
|
|
|
|
|
|
|
- name: Retrieve bot secrets
|
|
|
|
id: retrieve-bot-secrets
|
|
|
|
uses: bitwarden/gh-actions/get-keyvault-secrets@main
|
|
|
|
with:
|
|
|
|
keyvault: bitwarden-ci
|
|
|
|
secrets: "github-pat-bitwarden-devops-bot-repo-scope"
|
|
|
|
|
|
|
|
- name: "Bump version to ${{ steps.version.outputs.new_version }}"
|
|
|
|
env:
|
|
|
|
GH_TOKEN: ${{ steps.retrieve-bot-secrets.outputs.github-pat-bitwarden-devops-bot-repo-scope }}
|
|
|
|
run: |
|
|
|
|
echo '{"cut_rc_branch": "false", "version_number": "${{ steps.version.outputs.new_version }}"}' | \
|
|
|
|
gh workflow run version-bump.yml --json --repo bitwarden/mobile
|