v2.16.2 #53
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
release: | |
branches: [main] | |
types: [released] | |
workflow_dispatch: | |
inputs: | |
tag: | |
description: 'which tag to update to' | |
default: 'v2' | |
required: true | |
ref: | |
description: 'which branch to update the tag on' | |
default: 'main' | |
required: true | |
permissions: | |
contents: write | |
jobs: | |
re-tag: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v5 | |
with: | |
fetch-depth: 0 | |
ref: ${{ inputs.ref }} | |
- name: Config git name and email | |
run: | | |
git config user.name 'github-actions' | |
git config user.email '41898282+github-actions[bot]@users.noreply.github.com' | |
- name: Update rolling tag | |
run: | | |
# Get the major version from the latest tag | |
MAJOR_VERSION=`git tag --list --sort=-v:refname | head -n1 | cut -d. -f1` | |
git tag --force --annotate ${{ inputs.tag || '$MAJOR_VERSION' }} --message 'Retag ${{ inputs.tag || '$MAJOR_VERSION' }}' | |
git push origin ${{ inputs.tag || '$MAJOR_VERSION' }} --force |