-
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
76 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,40 @@ | ||
#!/usr/bin/env bash | ||
|
||
rm -Rf dist | ||
RELEASE_KIND=$(generate-changelog --output release-hint) | ||
echo "::notice::Suggested release type is: ${RELEASE_KIND}" | ||
PR_NUMBER=$(gh pr view --json number -q .number || echo "") | ||
echo "::notice::PR number is: ${PR_NUMBER}" | ||
export PR_NUMBER | ||
bump-my-version bump -v $RELEASE_KIND | ||
python -m build | ||
python -m twine upload dist/* | ||
|
||
function extract_version_content() { | ||
changelog=$1 | ||
target_version=$2 | ||
|
||
awk -v target="$target_version" ' | ||
/^## / { | ||
if (found) exit; | ||
version=$2; | ||
if (version == target) found=1; | ||
next; | ||
} | ||
found { print; } | ||
' <<< "$changelog" | ||
} | ||
|
||
#rm -Rf dist | ||
#RELEASE_KIND=$(generate-changelog --output release-hint) | ||
#echo "::notice::Suggested release type is: ${RELEASE_KIND}" | ||
#PR_NUMBER=$(gh pr view --json number -q .number || echo "") | ||
#echo "::notice::PR number is: ${PR_NUMBER}" | ||
#export PR_NUMBER | ||
#bump-my-version bump -v $RELEASE_KIND | ||
#python -m build | ||
#python -m twine upload dist/* | ||
|
||
changelog=$(cat "CHANGELOG.md") | ||
TARGET_VERSION=$(bump-my-version show current_version) | ||
echo "TAG_NAME=$TARGET_VERSION" | ||
NOTES=$(extract_version_content "$changelog" "$TARGET_VERSION") | ||
|
||
|
||
gh release create \ | ||
"${TARGET_VERSION}" \ | ||
./dist/* \ | ||
--title "${TARGET_VERSION}" \ | ||
--notes "${NOTES}" \ | ||
--draft \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/usr/bin/env bash | ||
|
||
|
||
function extract_version_content() { | ||
changelog=$1 | ||
target_version=$2 | ||
|
||
awk -v target="$target_version" ' | ||
/^## / { | ||
if (found) exit; | ||
version=$2; | ||
if (version == target) found=1; | ||
next; | ||
} | ||
found { print; } | ||
' <<< "$changelog" | ||
} | ||
|
||
changelog=$(cat "CHANGELOG.md") | ||
TARGET_VERSION=$(bump-my-version show current_version) | ||
NOTES=$(extract_version_content "$changelog" "$TARGET_VERSION") | ||
echo "Creating a GitHub release for version ${TARGET_VERSION} with notes." | ||
gh release create \ | ||
"${TARGET_VERSION}" \ | ||
./dist/* \ | ||
--title "${TARGET_VERSION}" \ | ||
--notes "${NOTES}" \ | ||
--draft |