char-fork/llama.cpp
git clone https://git.t4t.associates/char-fork/llama.cpp
e467c2ff6
char/aliceai-t5-moe
1#!/bin/bash 2# Generate the description of a release: the previous release version, the 3# change log and the link to the nightly release corresponding to the commit being released. 4# 5# Usage: make-release-desc.sh <version> 6# <version>: current release version (v<maj>.<min>.<pat>, the leading v is optional) 7# 8# The previous version is the highest plain semver tag (v<maj>.<min>.<pat>) 9# strictly below <version>. The change log lists all commits between the 10# previous version tag and the release commit, one line per commit. 11# 12# The release commit is the commit <version> points at when the tag exists, 13# HEAD otherwise. The nightly release is the b* tag pointing at that commit 14# (release.yml tags the same commit); the link is only generated when that 15# tag exists. 16# 17# Env (when running in GitHub Actions): 18# GITHUB_OUTPUT: previous_tag, changelog_title, changelog, nightly and nightly_tag 19# are written here 20# GITHUB_REPOSITORY: owner/repo, used to build the nightly release URL (skipped when unset) 21set -euo pipefail 22 23if [[$ # -ne 1 ]];then 24echo "Usage: $( basename " $ 0" ) <version>" 25exit 1 26fi 27VERSION =" $ 1 " 28 29# Accept the version with or without the leading v, reject anything else 30if [[" ${ VERSION } " =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]];then 31VERSION ="v ${ VERSION } " 32elif [[ !" ${ VERSION } " =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]];then 33echo "Error: invalid version ' ${ VERSION } ' (expected v<maj>.<min>.<pat>)" 34exit 1 35fi 36 37# Make sure all remote tags are available locally (skipped on local runs without origin) 38if !git fetch--tags origin2 > /dev/null;then 39echo "Warning: could not fetch tags from origin (local run?)" 40fi 41 42# Release commit: the commit <version> points at when the tag exists, HEAD otherwise. 43if !RELEASE_COMMIT =" $( git rev-parse -q --verify "refs/tags/ ${ VERSION } ^{commit}" 2 > /dev/null) " ;then 44RELEASE_COMMIT =" $( git rev-parse HEAD) " 45fi 46 47echo "Release commit: $( git rev-parse --short " ${ RELEASE_COMMIT } " ) " 48 49PREV =" $( { git tag --list ; echo " ${ VERSION } " ; } \ 50| grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' \ 51| sort -V \ 52| awk -v cur= " ${ VERSION } " '$0 == cur { exit } { prev = $0 } END { print prev }' ) " 53 54if [[ -n" ${ PREV } " ]];then 55CHANGELOG =" $( git log --oneline " ${ PREV } .. ${ RELEASE_COMMIT } " ) " 56CHANGELOG_TITLE ="Changelog since ${ PREV } " 57else 58CHANGELOG ="(no previous release tag found)" 59CHANGELOG_TITLE ="Changelog" 60fi 61 62# Nightly release: the b* tag pointing at the release commit (|| true: no match is not an error) 63NIGHTLY_TAG =" $( git tag --points-at " ${ RELEASE_COMMIT } " | grep -E '(^|-)b[0-9]+(-[0-9a-f]{7})?$' | head -n 1 || true ) " 64 65NIGHTLY ="" 66if [[ -n" ${ NIGHTLY_TAG } " ]];then 67if [[ -n" ${ GITHUB_REPOSITORY :-} " ]];then 68NIGHTLY_URL ="https://github.com/ ${ GITHUB_REPOSITORY } /releases/tag/ ${ NIGHTLY_TAG } " 69NIGHTLY ="**Nightly build:** [ ${ NIGHTLY_TAG } ]( ${ NIGHTLY_URL } )" 70echo "Nightly release: ${ NIGHTLY_URL } " 71fi 72else 73echo "No nightly release found for commit $( git rev-parse --short " ${ RELEASE_COMMIT } " ) " 74fi 75 76echo "Previous version: ${ PREV :-none} " 77echo " ${ CHANGELOG } " 78 79if [[ -n" ${ GITHUB_OUTPUT :-} " ]];then 80 { 81echo "previous_tag= ${ PREV } " 82echo "changelog_title= ${ CHANGELOG_TITLE } " 83echo "nightly= ${ NIGHTLY } " 84echo "nightly_tag= ${ NIGHTLY_TAG } " 85echo "changelog<<CHANGELOG_EOF" 86echo " ${ CHANGELOG } " 87echo "CHANGELOG_EOF" 88 }>> " ${ GITHUB_OUTPUT } " 89fi