Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions package/bin/before-tag.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ PACKAGE_VERSION=$(cat package.json | grep version | head -1 | awk -F: '{ print $
PACKAGE_VERSION_WITHOUT_SHA=$(echo "$PACKAGE_VERSION" | cut -d"+" -f1)

cd native-package
npm version --allow-same-version --no-git-tag-version "$PACKAGE_VERSION_WITHOUT_SHA"
npm version --no-workspaces --allow-same-version --no-git-tag-version "$PACKAGE_VERSION_WITHOUT_SHA"
sed -e 's|"stream-chat-react-native-core": "[^"]*"|"stream-chat-react-native-core": "'"$PACKAGE_VERSION_WITHOUT_SHA"'"|g' -i.bak package.json
rm package.json.bak

cd ../expo-package
npm version --allow-same-version --no-git-tag-version "$PACKAGE_VERSION_WITHOUT_SHA"
npm version --no-workspaces --allow-same-version --no-git-tag-version "$PACKAGE_VERSION_WITHOUT_SHA"
sed -e 's|"stream-chat-react-native-core": "[^"]*"|"stream-chat-react-native-core": "'"$PACKAGE_VERSION_WITHOUT_SHA"'"|g' -i.bak package.json
rm package.json.bak
cd ..
Expand All @@ -26,6 +26,3 @@ rm src/version.json.bak

git add {expo,native}-package/package.json
git add src/version.json

git add expo-package/yarn.lock
git add native-package/yarn.lock
8 changes: 4 additions & 4 deletions package/bin/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ PACKAGE_TAG=$(sed 's/.*-\(.*\)\..*/\1/' <<< "$PACKAGE_VERSION")
# If tag === version it means that its not a prerelease and shouuld set things to latest
if [[ "${PACKAGE_TAG}" != "${PACKAGE_VERSION}" ]]; then
cd native-package
npm publish --tag="$PACKAGE_TAG"
npm publish --no-workspaces --tag="$PACKAGE_TAG"

cd ../expo-package
npm publish --tag="$PACKAGE_TAG"
npm publish --no-workspaces --tag="$PACKAGE_TAG"
else
cd native-package
npm publish
npm publish --no-workspaces

cd ../expo-package
npm publish
npm publish --no-workspaces
fi


16 changes: 14 additions & 2 deletions release/release.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,21 @@ module.exports = Promise.resolve().then(() => {
},
],
[
'@semantic-release/npm',
'@semantic-release/exec',
{
npmPublish: isSDK,
// Bump the version (which also runs the `version` script, before-tag.sh)
// with --no-workspaces so npm doesn't try to reify the Yarn workspace
// tree — npm can't parse Yarn's workspace:/patch: protocols.
prepareCmd:
'npm version ${nextRelease.version} --no-workspaces --no-git-tag-version --allow-same-version',
// Only the SDK publishes to npm. Publishing core triggers its
// prepublishOnly hook (before-tag.sh && release.sh), which in turn
// publishes native-package and expo-package.
...(isSDK
? {
publishCmd: 'npm publish --no-workspaces --tag ${nextRelease.channel || "latest"}',
}
: {}),
},
],
];
Expand Down