Skip to content
Draft
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
111 changes: 111 additions & 0 deletions .github/workflows/github-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
name: GitHub Release

on:
push:
branches: ['@matipl01/github-release-action']
workflow_dispatch:
inputs:
package:
description: 'Package to release'
required: true
type: choice
options:
- reanimated
- worklets
version:
description: 'Version to release (e.g. 4.2.0)'
required: true
type: string
branch:
description: 'Branch to release from'
required: true
type: string
default: 'main'
dry_run:
description: 'Dry run (test without creating release)'
required: false
type: boolean
default: true

jobs:
github-release:
runs-on: ubuntu-latest
permissions:
contents: write
issues: write
pull-requests: write
env:
PACKAGE: ${{ inputs.package || 'reanimated' }}
VERSION: ${{ inputs.version || 'test-version' }}
BRANCH: ${{ inputs.branch || '4.0-stable' || github.ref_name }}
DRY_RUN: ${{ inputs.dry_run || 'true' }}
PACKAGE_DIR: packages/${{ (inputs.package || 'reanimated') == 'reanimated' && 'react-native-reanimated' || 'react-native-worklets' }}
PACKAGE_NAME: ${{ (inputs.package || 'reanimated') == 'reanimated' && 'React Native Reanimated' || 'React Native Worklets' }}
steps:
- name: Validate branch name
run: |
BRANCH="${{ env.BRANCH }}"
PACKAGE="${{ env.PACKAGE }}"

case "$PACKAGE" in
"reanimated")
if [[ "$BRANCH" =~ ^(main|[0-9]+\.[0-9]+-stable)$ ]]; then
echo "✅ Valid reanimated branch: $BRANCH"
else
echo "❌ Invalid reanimated branch: $BRANCH (expected: main or X.Y-stable)"
exit 1
fi
;;
"worklets")
if [[ "$BRANCH" =~ ^(main|worklets-[0-9]+\.[0-9]+-stable)$ ]]; then
echo "✅ Valid worklets branch: $BRANCH"
else
echo "❌ Invalid worklets branch: $BRANCH (expected: main or worklets-X.Y-stable)"
exit 1
fi
;;
*)
echo "❌ Unknown package: $PACKAGE"
exit 1
;;
esac

- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ env.BRANCH }}
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'yarn'

- name: Install dependencies
run: |
corepack enable
yarn install --immutable

- name: Configure Git
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"

- name: Run semantic-release
working-directory: ${{ env.PACKAGE == 'reanimated' && 'packages/react-native-reanimated' || 'packages/react-native-worklets' }}
run: |
if [ "${{ env.DRY_RUN }}" = "true" ]; then
echo "🧪 Running in dry-run mode - no release will be created"
yarn semantic-release --dry-run
else
echo "🚀 Creating actual release"
yarn semantic-release
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Clean up
run: |
echo "✅ Workflow completed successfully"
51 changes: 51 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"branches": ["main", "@matipl01/github-release-action"],
"plugins": [
[
"@semantic-release/commit-analyzer",
{
"preset": "conventionalcommits"
}
],
[
"@semantic-release/release-notes-generator",
{
"preset": "conventionalcommits",
"presetConfig": {
"types": [
{
"type": "feat",
"section": "🚀 Features"
},
{
"type": "fix",
"section": "🐛 Bug Fixes"
},
{
"type": "perf",
"section": "⚡ Performance Improvements"
},
{
"type": "docs",
"section": "📚 Documentation"
},
{
"type": "revert",
"section": "🔄 Reverts"
}
],
"other": "📝 Other Changes"
}
}
],
"semantic-release-yarn",
[
"@semantic-release/github",
{
"successComment": "🎉 This PR is included in version ${nextRelease.version} of ${name}!\n\n**Release Notes:**\n${nextRelease.notes}",
"releasedLabels": ["${nextRelease.version}"],
"addReleases": "bottom"
}
]
]
}
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@
"node-fetch": "^3.3.2",
"prettier": "^3.3.3",
"prettier-plugin-jsdoc": "^1.3.0",
"semantic-release": "^24.2.7",
"semantic-release-yarn": "^3.0.2",
"typescript": "5.8.3"
},
"resolutions": {
Expand Down
6 changes: 6 additions & 0 deletions packages/react-native-reanimated/.releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": ["../../.releaserc.json"],
"branches": ["main", "@matipl01/github-release-action"],
"tagFormat": "reanimated-${version}",
"name": "React Native Reanimated"
}
1 change: 1 addition & 0 deletions packages/react-native-reanimated/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"reanimated"
],
"scripts": {
"semantic-release": "semantic-release",
"test": "jest",
"lint": "yarn lint:js && yarn lint:common && yarn lint:android && yarn lint:apple",
"lint:js": "eslint src __tests__ __typetests__ && yarn prettier --check src __tests__ __typetests__",
Expand Down
6 changes: 6 additions & 0 deletions packages/react-native-worklets/.releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": ["../../.releaserc.json"],
"branches": ["main", "@matipl01/github-release-action"],
"tagFormat": "worklets-${version}",
"name": "React Native Worklets"
}
1 change: 1 addition & 0 deletions packages/react-native-worklets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"worklets"
],
"scripts": {
"semantic-release": "semantic-release",
"build": "yarn workspace babel-plugin-worklets build && bob build && yarn build:unpackers",
"build:unpackers": "node ./scripts/export-unpackers.js",
"circular-dependency-check": "yarn madge --extensions js,jsx --circular lib",
Expand Down
Loading
Loading