1#!/bin/sh 2# Copyright (c) 2023 Petr Vorel <pvorel@suse.cz> 3# Tag LTP release. 4# https://github.com/linux-test-project/ltp/wiki/LTP-Release-Procedure 5set -e 6 7upstream_git="linux-test-project/ltp" 8tag="$(date +%Y%m%d)" 9old_tag="$(git describe --abbrev=0)" 10tag_msg="LTP $tag" 11 12. $(dirname "$0")/lib.sh 13 14cd $(dirname "$0")/.. 15 16if ! git ls-remote --get-url origin | grep -q $upstream_git; then 17 quit "Not an upstream project" 18fi 19 20if ! git --no-pager diff --exit-code; then 21 quit "Please commit your changes before making new release" 22fi 23 24if git show $tag 2> /dev/null; then 25 quit "Tag '$tag' already exists" 26fi 27 28if grep -q "$tag" VERSION; then 29 quit "Tag '$tag' already in VERSION file" 30fi 31 32title "git tag" 33echo "new tag: '$tag', previous tag: '$old_tag'" 34echo "$tag" > VERSION 35git add VERSION 36rod git commit -S --signoff --message \"$tag_msg\" VERSION 37rod git tag --sign --annotate $tag --message \"$tag_msg\" 38git --no-pager show $tag --show-signature 39 40ask "Please check tag and signature" 41 42title "git push" 43ask "Pushing changes to upstream git" 44rod git push origin master:master 45git push origin $tag 46