-
Notifications
You must be signed in to change notification settings - Fork 1
/
publish
executable file
·30 lines (25 loc) · 858 Bytes
/
publish
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#! /bin/bash
set -e
dry_run=
./patch-readme
if ! git diff-index --quiet HEAD --
then
printf '⚠️ WARNING: There are uncommitted changes. Commit or restore before proceeding with publish\n' >&2
exit 1
fi
eval $(grep 'VERSION *=' setup.py | tr '[:upper:]' '[:lower:]' | sed 's/ *= */=/')
tag="v$version"
title="v$version"
$dry_run git tag "$tag" || printf 'WARNING: tag "%s" already exists\n' "$tag"
$dry_run git push --tags
blue=$(tput setaf 32)
sgr0=$(tput sgr0)
if which -s gh
then
$dry_run gh release create --title "$title" --generate-notes "$tag"
else
printf '\nNext steps:\n'
printf '1. Create new release on Github using tag=%s title=%s\n' "$tag" "$title"
printf ' url: %s%s%s\n' "${blue}" 'https://github.com/dtmilano/AndroidViewClient/releases/new' "${sgr0}"
fi
printf '😼 Now Github Actions should follow...\n'