Skip to content

Commit ebc1383

Browse files
script changes
1 parent 6c9636d commit ebc1383

File tree

3 files changed

+42
-17
lines changed

3 files changed

+42
-17
lines changed

payment_sdk/CHANGELOG.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
# CHANGELOG
1+
# Changelog
22

3-
## 0.0.4
3+
All notable changes to this project will be documented in this file.
44

5-
**Changes**
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
67

8+
## 0.0.4 - 2023-07-22
9+
10+
### Added
711
- Dark theme support on both `ios` and `android` platforms.

payment_sdk/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@komoju/komoju-react-native",
3-
"version": "0.0.4",
3+
"version": "0.0.3",
44
"private": false,
55
"description": "degica payment SDK",
66
"main": "dist/index.js",

payment_sdk/scripts/publish.sh

Lines changed: 34 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,35 +14,56 @@ ARGS:
1414
EOF
1515
}
1616

17-
get_latest_changelog() {
18-
local version=$(node -p "require('./package.json').version")
19-
awk "/## $version/,/^$/ { if (!/^## / && !/^$/) print }" CHANGELOG.md
17+
percentEncodeString() {
18+
jq -rn --arg x "$1" '$x|@uri'
2019
}
2120

2221
create_github_release() {
23-
local current_version=$(node -p "require('./package.json').version")
24-
local changelog=$(get_latest_changelog)
25-
local release_notes="v$current_version
22+
local release_notes
23+
local changelog
24+
local is_collecting=0
25+
while IFS= read -r line; do
26+
if [[ $line == \#\#[[:space:]]*[[:digit:]]* ]]; then
27+
if [ $is_collecting == 0 ] ; then
28+
# Reached the entry for the version that is to be published
29+
is_collecting=1
30+
local version_and_date="${line#* }"
31+
else
32+
# Reached the next version entry, we're done.
33+
break
34+
fi
35+
elif [ $is_collecting == 1 ] ; then
36+
changelog+="${line}
37+
"
38+
fi
39+
done < CHANGELOG.md
40+
41+
release_notes="$(cat << EOF
42+
$version_and_date
2643
27-
Changes:
2844
$changelog
2945
30-
For full details, see the [CHANGELOG.md](https://github.com/degica/mobile-sdk_react-native/blob/main/payment_sdk/CHANGELOG.md)."
46+
Please [see the changelog](https://github.com/degica/mobile-sdk_react-native/blob/main/payment_sdk/CHANGELOG.md) for additional details.
47+
EOF
48+
)"
3149

3250
if ! command -v hub &> /dev/null; then
33-
echo "hub command not found. Falling back to manual release creation."
3451
create_github_release_fallback "$release_notes"
3552
else
53+
local current_version=${version_and_date% -*}
3654
echo "Creating GitHub release for tag: v$current_version"
3755
echo ""
38-
hub release create -m "$release_notes" "v$current_version"
56+
echo -n " "
57+
hub release create -em "$release_notes" "v$current_version"
3958
fi
4059
}
4160

4261
create_github_release_fallback() {
4362
local release_notes=$1
44-
echo "Please create a release manually on GitHub at https://github.com/degica/mobile-sdk_react-native/releases/new with the following notes:"
45-
echo "$release_notes"
63+
cat << EOF
64+
Remember to create a release on GitHub at https://github.com/degica/mobile-sdk_react-native/releases/new with the following notes:
65+
$release_notes
66+
EOF
4667
}
4768

4869
# Show help if no arguments passed
@@ -108,7 +129,7 @@ echo "Bumping package.json $RELEASE_TYPE version and tagging commit"
108129
npm version $RELEASE_TYPE
109130

110131
echo "Publishing release to npm"
111-
npm publish --access=public
132+
# npm publish --access=public
112133

113134
echo "Pushing git commit and tag"
114135
git push --follow-tags

0 commit comments

Comments
 (0)