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
27 changes: 23 additions & 4 deletions .github/workflows/release-sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ jobs:
recover-stale-releases:
name: Recover Stale Releases
runs-on: ubuntu-latest
outputs:
npm_tags_created: ${{ steps.recover.outputs.npm_tags_created }}
# Runs on every trigger but steps are conditioned on push events.
# This ensures the job always succeeds (never "skipped"), so downstream
# jobs can depend on it without if: always() — which breaks output propagation.
Expand All @@ -52,6 +54,7 @@ jobs:
fetch-depth: 0

- name: Create missing manifest tags and relabel stale PRs
id: recover
if: github.event_name == 'push'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -89,6 +92,10 @@ jobs:
fi
done

# Signal that new npm package tags were created (release PR was merged
# but release-please failed to tag — common with grouped PRs).
echo "npm_tags_created=${TAGGED}" >> "$GITHUB_OUTPUT"

# If we just created tags, find any merged release PRs that are still
# labeled 'autorelease: pending' and flip them to 'autorelease: tagged'
# so that release-please no longer considers them untagged.
Expand Down Expand Up @@ -135,7 +142,7 @@ jobs:
fi
done

for token in '${scope}' '${version}'; do
for token in '${scope}'; do
if [[ "$group_pattern" != *"$token"* ]]; then
echo "::error::group-pull-request-title-pattern must include $token"
exit 1
Expand Down Expand Up @@ -171,8 +178,20 @@ jobs:
echo "::notice::workflow_dispatch — npm_publish=${NPM_PUBLISH}, gateway_release_created=${GATEWAY_RELEASE_CREATED}, gateway_tag=${GATEWAY_TAG}"
else
# All npm packages use linked-versions, so sdk is representative.
# No fallback to releases_created — that includes gateway-only releases.
NPM_PUBLISH="${{ steps.release.outputs['sdk--release_created'] }}"
RP_NPM="${{ steps.release.outputs['sdk--release_created'] }}"

# Fallback: release-please cannot create GitHub Releases from grouped
# PRs (the merged PR title lacks ${component}). When that happens the
# recover-stale-releases job still creates the git tags. Use its
# npm_tags_created output as a reliable signal that a release PR was
# merged and npm packages should be published.
RECOVER_NPM="${{ needs.recover-stale-releases.outputs.npm_tags_created }}"

if [[ "$RP_NPM" == "true" || "$RECOVER_NPM" == "1" ]]; then
NPM_PUBLISH="true"
else
NPM_PUBLISH=""
fi

{
echo "releases_created=${{ steps.release.outputs.releases_created }}"
Expand All @@ -182,7 +201,7 @@ jobs:
echo "npm_publish=${NPM_PUBLISH}"
} >> "$GITHUB_OUTPUT"

echo "::notice::push — releases_created=${{ steps.release.outputs.releases_created }}, npm_publish=${NPM_PUBLISH}, gateway=${{ steps.release.outputs['gateway--release_created'] }}"
echo "::notice::push — releases_created=${{ steps.release.outputs.releases_created }}, rp_npm=${RP_NPM}, recover_npm=${RECOVER_NPM}, npm_publish=${NPM_PUBLISH}, gateway=${{ steps.release.outputs['gateway--release_created'] }}"
fi

publish-npm:
Expand Down
8 changes: 4 additions & 4 deletions examples/todo-react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rep-example-todo-react",
"version": "0.1.4",
"version": "0.1.7",
"private": true,
"description": "Example: Todo app showing REP gateway + React SDK integration",
"scripts": {
Expand All @@ -14,16 +14,16 @@
"rep:serve": "rep dev --port 3000 --env .env.local --static ./dist --hot-reload"
},
"dependencies": {
"@rep-protocol/react": "^0.1.6",
"@rep-protocol/sdk": "^0.1.6",
"@rep-protocol/react": "^0.1.7",
"@rep-protocol/sdk": "^0.1.7",
"react": "^18.3.0",
"react-dom": "^18.3.0"
},
"devDependencies": {
"@types/react": "^18.3.0",
"@types/react-dom": "^18.3.0",
"@vitejs/plugin-react": "^4.3.0",
"@rep-protocol/cli": "^0.1.4",
"@rep-protocol/cli": "^0.1.7",
"typescript": "^5.4.0",
"vite": "^5.4.0"
}
Expand Down
2 changes: 1 addition & 1 deletion release-please-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"release-type": "node",
"bump-minor-pre-major": true,
"bump-patch-for-minor-pre-major": true,
"group-pull-request-title-pattern": "chore${scope}: release ${version}",
"group-pull-request-title-pattern": "chore${scope}: release",
"pull-request-title-pattern": "chore${scope}: release ${component} ${version}",
"include-component-in-tag": true,
"plugins": [
Expand Down