Skip to content
This repository has been archived by the owner on Jul 3, 2024. It is now read-only.

Tag Branches With New Version #4

Tag Branches With New Version

Tag Branches With New Version #4

Workflow file for this run

name: Tag Branches With New Version
run-name: Tag Branches With New Version
on:
pull_request_target:
types:
- closed
branches:
- 'mps/2021.3'
# allow manual execution just in case
workflow_dispatch:
jobs:
tagBranches:
# only trigger if the PR was actually merged or is manually triggered
if: ( github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch' )
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
token: ${{secrets.MPS_REPO_PAT}}
ref: '${{ github.ref_name }}'
fetch-depth: 0
- name: Calculate next patch number
run: |
lastVersion=$(git tag | grep "^2020.3\.[0-9]*$" | sort -V | tail -n1 | cut -d . -f 3)
nextVersion=$((lastVersion+1))
echo "nextVersion=$nextVersion" >> $GITHUB_ENV
- name: Switch to branch mps/2020.3
run: git switch mps/2020.3
- name: Tag 2020.3 with new version
uses: anothrNick/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.MPS_REPO_PAT }}
CUSTOM_TAG: 2020.3.${{ env.nextVersion }}
DEFAULT_BRANCH: mps/2020.3
- name: Switch to branch mps/2021.1
run: git switch mps/2021.1
- name: Tag 2021.1 with new version
uses: anothrNick/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.MPS_REPO_PAT }}
CUSTOM_TAG: 2021.1.${{ env.nextVersion }}
DEFAULT_BRANCH: mps/2021.1
- name: Switch to branch mps/2021.2
run: git switch mps/2021.2
- name: Tag 2021.2 with new version
uses: anothrNick/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.MPS_REPO_PAT }}
CUSTOM_TAG: 2021.2.${{ env.nextVersion }}
DEFAULT_BRANCH: mps/2021.2
- name: Switch to branch mps/2021.3
run: git switch mps/2021.3
- name: Tag 2021.3 with new version
uses: anothrNick/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.MPS_REPO_PAT }}
CUSTOM_TAG: 2021.3.${{ env.nextVersion }}
DEFAULT_BRANCH: mps/2021.3