mirror of
https://framagit.org/framasoft/mobilizon.git
synced 2024-12-22 07:52:43 +00:00
Add basic release script
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
deda902b7c
commit
c5cf4a79c6
1 changed files with 26 additions and 0 deletions
26
scripts/release.sh
Executable file
26
scripts/release.sh
Executable file
|
@ -0,0 +1,26 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
if [ -z "$1" ]; then
|
||||||
|
echo "Need version as argument"
|
||||||
|
exit -1
|
||||||
|
fi
|
||||||
|
|
||||||
|
version="$1"
|
||||||
|
changelog=$(awk -v version="$version" '/^## / { printit = $2 == version }; printit' CHANGELOG.md | grep -v "## $version" | sed '1{/^$/d}')
|
||||||
|
|
||||||
|
printf "Changelog will be:\\n\\n%s\\n\\n" "$changelog"
|
||||||
|
|
||||||
|
read -p "Are you sure to release? " -n 1 -r
|
||||||
|
echo
|
||||||
|
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
git tag -s -a "$version" -m "$changelog"
|
||||||
|
|
||||||
|
APP_VERSION="${CI_COMMIT_TAG}"
|
||||||
|
APP_ASSET="${CI_PROJECT_NAME}_${APP_VERSION}_${ARCH}.tar.gz"
|
||||||
|
|
||||||
|
release-cli create --name "$CI_COMMIT_TAG" --tag-name "$CI_COMMIT_TAG" --assets-link "{\"name\":\"${APP_ASSET}\",\"url\":\"${PACKAGE_REGISTRY_URL}/${APP_VERSION}/${APP_ASSET}\"}"
|
Loading…
Reference in a new issue