Skip to content

Update major release to 2.26.4 #218

Update major release to 2.26.4

Update major release to 2.26.4 #218

name: Update Major Release
run-name: Update major release to ${{ github.event.inputs.target || github.event.release.name }}
on:
release:
types: [published]
workflow_dispatch:
inputs:
target:
description: The tag or reference to use
required: true
major_version:
type: choice
description: The major version to update
options:
- "2"
- "1"
jobs:
tag:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Git config
run: |
git config user.name github-actions
git config user.email [email protected]
- name: Get target
run:
echo "TARGET=$(echo "${{ github.event.inputs.target || github.event.release.name }}" | tr -d '[:space:]')" >> $GITHUB_ENV
- name: Get major version
run: |
if [[ -z "${{ github.event.inputs.major_version }}" ]]; then
echo "MAJOR_VERSION=$(echo "${{ github.event.release.name }}" | cut -d. -f1)" >> $GITHUB_ENV
else
echo "MAJOR_VERSION=${{ github.event.inputs.major_version }}" >> $GITHUB_ENV
fi
- name: Tag new target
run: |
git tag -f ${{ env.MAJOR_VERSION }} ${{ env.TARGET }}
git tag -f latest ${{ env.TARGET }}
- name: Push new tag
run: |
git push origin ${{ env.MAJOR_VERSION }} --force
git push origin latest --force