Skip to content

Commit

Permalink
feat: add a release.sh file that format version.py and README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
nroulon committed May 3, 2024
1 parent 77ad7f7 commit 56476d8
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env bash
set -euo pipefail

script_directory="$(cd "$(dirname "$(readlink -f ${BASH_SOURCE[0]})")" &> /dev/null && pwd)"
version="$1"

echo "change version in files"
echo "__version__ = '$version'" > "$script_directory/aki/version.py"
sed -i'.bak' -e "s@^pipx install .*@pipx install https://github.com/4sh/aki/releases/download/$version/aki-$version.tar.gz@" "README.md"
sed -i'.bak' -e "s@^version = .*@version = \"$version\"@" "pyproject.toml"
rm README.md.bak pyproject.toml.bak

echo "poetry build"
poetry build

echo "commit and tag"
git commit --all --message "release $version"
git tag "v$version"

echo "upload $script_directory/dist/aki-$version.tar.gz to a new release $version on https://github.com/4sh/aki/releases"
echo "push for publish docker package"

0 comments on commit 56476d8

Please sign in to comment.