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 1aa06ae
Show file tree
Hide file tree
Showing 4 changed files with 199 additions and 239 deletions.
23 changes: 20 additions & 3 deletions assets/release/release-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,22 @@ 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

git add -u
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 +38,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 Down
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 1aa06ae

Please sign in to comment.