2022-08-02 10:34:07 +03:00
|
|
|
---
|
2022-07-29 13:18:57 +03:00
|
|
|
name: Version Auto Bump
|
|
|
|
|
|
|
|
on:
|
2022-10-17 12:50:38 +03:00
|
|
|
push:
|
|
|
|
tags:
|
|
|
|
- v**
|
2022-07-29 13:18:57 +03:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
setup:
|
|
|
|
name: "Setup"
|
2022-10-11 17:27:07 +03:00
|
|
|
runs-on: ubuntu-22.04
|
2022-08-02 10:34:07 +03:00
|
|
|
outputs:
|
|
|
|
version_number: ${{ steps.version.outputs.new-version }}
|
2022-07-29 13:18:57 +03:00
|
|
|
steps:
|
2022-08-02 10:34:07 +03:00
|
|
|
- name: Checkout Branch
|
2023-09-06 17:30:47 +03:00
|
|
|
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
|
2022-08-02 10:34:07 +03:00
|
|
|
|
2022-10-11 17:27:07 +03:00
|
|
|
- name: Calculate bumped version
|
2022-08-02 10:34:07 +03:00
|
|
|
id: version
|
|
|
|
env:
|
2022-10-17 12:50:38 +03:00
|
|
|
RELEASE_TAG: ${{ github.ref }}
|
2022-08-02 10:34:07 +03:00
|
|
|
run: |
|
2023-01-16 20:45:23 +03: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 12:50:38 +03:00
|
|
|
echo "Current Major: $CURR_MAJOR"
|
2022-10-11 17:27:07 +03:00
|
|
|
echo "Current Patch: $CURR_PATCH"
|
2022-08-02 10:34:07 +03:00
|
|
|
|
2022-10-17 12:50:38 +03:00
|
|
|
NEW_PATCH=$((CURR_PATCH+1))
|
2022-10-11 17:27:07 +03:00
|
|
|
NEW_VER=$CURR_MAJOR.$NEW_PATCH
|
|
|
|
echo "New Version: $NEW_VER"
|
2022-12-05 18:04:34 +03:00
|
|
|
echo "new-version=$NEW_VER" >> $GITHUB_OUTPUT
|
2022-08-02 10:34:07 +03:00
|
|
|
|
|
|
|
trigger_version_bump:
|
2023-07-13 18:55:16 +03:00
|
|
|
name: Bump version to ${{ needs.setup.outputs.version_number }}
|
|
|
|
needs: setup
|
|
|
|
uses: ./.github/workflows/version-bump.yml
|
|
|
|
with:
|
|
|
|
version_number: ${{ needs.setup.outputs.version_number }}
|
2023-12-12 18:22:22 +03:00
|
|
|
secrets: inherit
|