Skip to content

Commit

Permalink
create final release when tag_name provided
Browse files Browse the repository at this point in the history
  • Loading branch information
o-orand committed Jan 16, 2024
1 parent 2dd8725 commit a2f1727
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,26 @@ echo " dir: $INPUT_DIR"
echo " override_existing: $INPUT_OVERRIDE_EXISTING"
echo " tag_name: $INPUT_TAG_NAME"
echo " target_branch: $INPUT_TARGET_BRANCH"
echo " debug: $INPUT_DEBUG"

if [[ "$INPUT_DIR" != "." ]];then
cd $INPUT_DIR # We ensure we are in the right directory
git config --global --add safe.directory /github/workspace/$INPUT_DIR
fi

echo "Current dir: $PWD"
echo "Current files:"
ls -l
if [ -n "$INPUT_TAG_NAME" ];then
echo "Tag_name detected. Overriding version name and enabling final release"
version=$INPUT_TAG_NAME
release=true
fi


if [ $INPUT_DEBUG -ne 0 ];then
echo "Current files before release creation:"
echo "Current files:"
ls -l
fi

PUSH_OPTIONS=""
if [ "${INPUT_OVERRIDE_EXISTING}" == "true" ];then
PUSH_OPTIONS="$PUSH_OPTIONS --force"
Expand Down Expand Up @@ -100,6 +109,13 @@ if [ "${release}" == "true" ]; then
git push ${remote_repo} HEAD:${INPUT_TARGET_BRANCH} --follow-tags # Push branch and tag
fi


if [ $INPUT_DEBUG -ne 0 ];then
echo "Current files after release creation:"
ls -l
fi


# make asset readable outside docker image
chmod 644 ${name}-${version}.tgz
# https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#environment-files
Expand Down

0 comments on commit a2f1727

Please sign in to comment.