Skip to content

Commit

Permalink
fix(deps): bump python-semantic-release to ^8.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
edeckers committed Aug 30, 2023
1 parent 769b3ba commit 79c8d0b
Show file tree
Hide file tree
Showing 4 changed files with 198 additions and 240 deletions.
23 changes: 19 additions & 4 deletions assets/release/release-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,20 @@ function publish_semantic_release () {

set_github_actions_git_details

publish_result=`p run semantic-release publish 2>&1`
echo "Running semantic-release version"

echo "Update versions in files"
assets/release/update-versions.sh
echo "Updated all versions in files"

version_result=`p run semantic-release version 2>&1`
error_code=`echo $?`
is_error_code=`[ ${error_code} -ne 0 ] && echo 1 || echo 0`

no_release_count=`echo "${publish_result}" | grep -cim1 "no release"`
no_release_count=`echo "${version_result}" | grep -cim1 "no release"`
is_release=`[ ${no_release_count} -eq 0 ] && echo 1 || echo 0`

echo "${publish_result}"
echo "${version_result}"

if [[ ${is_error_code} -eq 1 || ${is_release} -ne 1 ]]; then
echo "has error code: ${is_error_code}"
Expand All @@ -30,6 +36,15 @@ function publish_semantic_release () {
echo "Received error code or no release was created. Aborting."
exit 0
fi
echo "Ran semantic-release version"

echo "Running semantic-release publish"
# p run semantic-release publish
echo "Ran semantic-release publish"

echo "Releasing to PyPi through Twine"
# p run twine upload dist/* --username __token__ --password ${PYPI_TOKEN}
echo "Released to PyPi through Twine"

echo "Published release"
}
Expand All @@ -47,4 +62,4 @@ publish_semantic_release
source assets/release/release-docker.sh

build_dist
build_and_publish_docker_image
# build_and_publish_docker_image
20 changes: 20 additions & 0 deletions assets/release/update-versions.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env bash

function cd_to_root_directory () {
cd `dirname ${0}`/../../
}

cd_to_root_directory

source src/bin/shared.sh

VERSION=$(cat pyproject.toml | grep "^version *= *\"[0-9]\.[0-9]\.[0-9]\"$" | sed -r 's/^version *= *\"(.*)\"$/\1/')
NEXT_VERSION=$(p run semantic-release --noop version --print)

echo "Replacing all occurences of ${VERSION} with ${NEXT_VERSION}"

sed -i"" "s/edeckers\/huemon:${VERSION}/edeckers\/huemon:${NEXT_VERSION}/g" assets/release/release-docker.sh
sed -i"" "s/edeckers\/huemon:${VERSION}/edeckers\/huemon:${NEXT_VERSION}/g" docker-compose.yml
sed -i"" "s/ARG HUEMON_VERSION=${VERSION}/ARG HUEMON_VERSION=${NEXT_VERSION}/g" Dockerfile

echo "Replaced all occurrences of ${VERSION} with ${NEXT_VERSION}"
Loading

0 comments on commit 79c8d0b

Please sign in to comment.