Skip to content
Open
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
23 changes: 22 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,25 @@ jobs:
- uses: volta-cli/action@v4

- run: yarn install --frozen-lockfile
- run: npm publish
- run: npm publish

- name: Setup Deno
uses: denoland/setup-deno@v2
with:
deno-version: v2.x
continue-on-error: true

- name: Clone small-things
uses: actions/checkout@v6
with:
repository: smallcase/small-things
path: small-things
token: ${{ secrets.GH_PAT }}
continue-on-error: true

- name: Track release
env:
SMALL_THINGS_PATH: small-things
NOTIFY_WEBHOOK_URL: ${{ secrets.NOTIFY_WEBHOOK_URL }}
run: bash scripts/track-release.sh --version $(node -p "require('./package.json').version")
continue-on-error: true
36 changes: 36 additions & 0 deletions scripts/track-release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/usr/bin/env bash
# Tracks an npm release in small-things (Slack notification).
# Non-critical: failures are logged but do not affect the release.
#
# Usage: track-release.sh --version <version>
set -o pipefail

while [[ $# -gt 0 ]]; do
case "$1" in
--version) VERSION="$2"; shift 2 ;;
*) echo "Unknown argument: $1"; exit 1 ;;
esac
done

if [[ -z "$VERSION" ]]; then
echo "Warning: No version provided. Skipping release tracking."
exit 0
fi

SDK_NAME="react-native-smallcase-gateway"
RELEASE_TYPE="${RELEASE_TYPE:-prod}"

echo "Tracking release: $SDK_NAME v$VERSION (type: $RELEASE_TYPE)"

TRACK_ARGS=(
--platform react-native
--sdkName "$SDK_NAME"
--version "$VERSION"
--publishTarget "npm"
--releaseType "$RELEASE_TYPE"
)
[ -n "${NOTIFY_WEBHOOK_URL:-}" ] && TRACK_ARGS+=( --webhookUrl "$NOTIFY_WEBHOOK_URL" )

small-things gw track-release "${TRACK_ARGS[@]}" 2>&1 || {
echo "Warning: Failed to track release in small-things (non-critical - release was successful)"
}
Loading