Skip to content

chore: update version strings #44

chore: update version strings

chore: update version strings #44

Workflow file for this run

# This workflow runs when a version tag is pushed.
#
# - Get new tag.
# - If release tag:
# - Get next semantic version.
# - Close old milestones.
# - Create new minor version milestone.
# - Create new major version milestone.
name: Version Tag Workflow
on:
push:
tags:
- 'v*'
jobs:
manage_milestones:
name: Manage Milestones
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: master
- name: Get new tag
id: newversion
run: |
tag=${GITHUB_REF/refs\/tags\//}
version=$(echo $tag | sed 's/-rc[0-9]*//')
if [[ $tag != *"-rc"* ]]; then
echo "do_milestones=1" >> $GITHUB_ENV
echo "tag=$(echo $tag)" >> $GITHUB_OUTPUT
echo "version=$(echo $version)" >> $GITHUB_OUTPUT
fi
echo "New tag is: $tag"
echo "New version is: $version"
echo "GitHub ref: ${{ github.ref }}"
- name: Get next semantic version
id: nextversion
if: ${{ env.do_milestones == 1 }}
uses: WyriHaximus/github-action-next-semvers@v1.2.1
with:
version: ${{ steps.newversion.outputs.version }}
- name: Close old milestone
if: ${{ env.do_milestones == 1 }}
uses: WyriHaximus/github-action-close-milestone@master
with:
number: ${{ steps.newversion.outputs.version }}
- name: Create new minor release milestone
if: ${{ env.do_milestones == 1 }}
uses: WyriHaximus/github-action-create-milestone@v1.2.0
with:
title: "${{ steps.nextversion.outputs.v_minor }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create new major release milestone
if: ${{ env.do_milestones == 1 }}
uses: WyriHaximus/github-action-create-milestone@v1.2.0
with:
title: "${{ steps.nextversion.outputs.v_major }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}