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
57 changes: 44 additions & 13 deletions .github/workflows/changesets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ jobs:
# gh release create "v$VERSION" --generate-notes --target main

- name: Publish NPM pre-release
id: publish_prerelease
if: steps.changesets.outputs.published != 'true'
continue-on-error: true
env:
Expand All @@ -74,24 +75,54 @@ jobs:
yarn run changeset publish --no-git-tag --snapshot canary --tag canary

- name: Get NPM Version
if: steps.changesets.outputs.published != 'true'
if: steps.publish_prerelease.outcome == 'success'
id: get_version
run: |
VERSION=$(node -pe "require('./package.json').version")
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT

- name: Comment Version on Pull Request
if: steps.changesets.outputs.published != 'true'
if: steps.publish_prerelease.outcome == 'success' && steps.changesets.outputs.pullRequestNumber
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Find PR associated with the current commit
PR_NUMBER=$(gh api repos/${{ github.repository }}/commits/${{ github.sha }}/pulls \
--jq '.[0].number' 2>/dev/null || echo "")

if [ -n "$PR_NUMBER" ] && [ "$PR_NUMBER" != "null" ]; then
gh pr comment $PR_NUMBER --body "Published pre-release version: ${{ env.VERSION }}"
echo "Commented on PR #$PR_NUMBER"
else
echo "No associated PR found. This might be a direct push to main."
fi
gh pr comment ${{ steps.changesets.outputs.pullRequestNumber }} \
--body "Published pre-release version: ${{ steps.get_version.outputs.VERSION }}"
echo "Commented on PR #${{ steps.changesets.outputs.pullRequestNumber }}"

- name: Send Slack notification
if: steps.publish_prerelease.outcome == 'success'
continue-on-error: true
uses: slackapi/slack-github-action@91efab103c0de0a537f72a35f6b8cda0ee76bf0a
with:
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
webhook-type: incoming-webhook
payload: |
{
"text": "📦 AppKit RN Canary Published",
"blocks": [
{
"type": "header",
"text": { "type": "plain_text", "text": "📦 AppKit RN Canary Published" }
},
{
"type": "section",
"fields": [
{ "type": "mrkdwn", "text": "*Version:*\n`${{ steps.get_version.outputs.VERSION }}`" },
{ "type": "mrkdwn", "text": "*Tag:*\n`canary`" },
{ "type": "mrkdwn", "text": "*Branch:*\n`${{ github.ref_name }}`" },
{ "type": "mrkdwn", "text": "*Triggered by:*\n`${{ github.actor }}`" }
]
},
{
"type": "section",
"text": { "type": "mrkdwn", "text": "*NPM:* <https://www.npmjs.com/package/@reown/appkit-react-native/v/${{ steps.get_version.outputs.VERSION }}|@reown/appkit-react-native>" }
},
{
"type": "context",
"elements": [
{ "type": "mrkdwn", "text": "Install: `yarn add @reown/appkit-react-native@canary`" }
]
}
]
}
44 changes: 44 additions & 0 deletions .github/workflows/snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,50 @@ jobs:
yarn run changeset:prepublish:ci
yarn run changeset publish --no-git-tag --snapshot $snapshot --tag $snapshot

- name: Get NPM Version
if: steps.check-changesets.outputs.has_changesets == 'true'
id: get_version
run: |
VERSION=$(node -pe "require('./package.json').version")
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT

- name: Send Slack notification
if: steps.check-changesets.outputs.has_changesets == 'true'
continue-on-error: true
uses: slackapi/slack-github-action@91efab103c0de0a537f72a35f6b8cda0ee76bf0a
with:
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
webhook-type: incoming-webhook
payload: |
{
"text": "📦 AppKit RN Snapshot Published",
"blocks": [
{
"type": "header",
"text": { "type": "plain_text", "text": "📦 AppKit RN Snapshot Published" }
},
{
"type": "section",
"fields": [
{ "type": "mrkdwn", "text": "*Version:*\n`${{ steps.get_version.outputs.VERSION }}`" },
{ "type": "mrkdwn", "text": "*Tag:*\n`${{ steps.determine-tag.outputs.tag }}`" },
{ "type": "mrkdwn", "text": "*Branch:*\n`${{ github.ref_name }}`" },
{ "type": "mrkdwn", "text": "*Triggered by:*\n`${{ github.actor }}`" }
]
},
{
"type": "section",
"text": { "type": "mrkdwn", "text": "*NPM:* <https://www.npmjs.com/package/@reown/appkit-react-native/v/${{ steps.get_version.outputs.VERSION }}|@reown/appkit-react-native>" }
},
{
"type": "context",
"elements": [
{ "type": "mrkdwn", "text": "Install: `yarn add @reown/appkit-react-native@${{ steps.determine-tag.outputs.tag }}`" }
]
}
]
}

- name: Get Snapshot Tag
id: get-snapshot-tag
run: |
Expand Down