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
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @furkando @NGabuaeva @EdiOanceaV2 @sinantalhakosar @rturtu @hikmet-demir @Matteoverzotti @robertbarbu27 @felipe-lighter
14 changes: 14 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
## Proposed Change

_Describe what this pull request does?_

## To-Do

_Add to-do items here_

- [ ] Does it need backend deployment?
- [ ] Does it need confirmation on calculations?

## Screenshot

_Add screenshots or short video_
24 changes: 24 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
groups:
patch-updates:
applies-to: version-updates
patterns: ['*']
update-types:
- "patch"
open-pull-requests-limit: 1
target-branch: "main"
pull-request-branch-name:
separator: "-"
commit-message:
prefix: "[dependabot] Patch update: "
ignore:
- dependency-name: "react"
- dependency-name: "react-native"
# For all packages, ignore all minor and major updates
- dependency-name: "*"
update-types: ["version-update:semver-major", "version-update:semver-minor"]
100 changes: 100 additions & 0 deletions .github/workflows/cleanup-prereleases.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
name: Cleanup Prereleases

on:
pull_request:
types: [closed]
branches: [main]

jobs:
cleanup:
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true
permissions:
contents: write
packages: write
pull-requests: write
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}

- name: Set NPM_TOKEN for GitHub Packages
run: echo "NPM_TOKEN=${{ secrets.GH_PACKAGE_TOKEN }}" >> $GITHUB_ENV

# Setup Node.js and npm
- uses: actions/setup-node@v4
with:
node-version: "22.19.0"
registry-url: 'https://npm.pkg.github.com'
scope: '@elliottech'

# Get PR information
- name: Get PR information
id: pr_info
run: |
PR_NUMBER=${{ github.event.number }}
BRANCH_NAME="${{ github.head_ref }}"

# Clean branch name for npm (same logic as prerelease workflow)
CLEAN_BRANCH_NAME=$(echo "$BRANCH_NAME" | sed 's/[^a-zA-Z0-9-]/-/g' | sed 's/--*/-/g' | sed 's/^-\|-$//g')

echo "PR Number: $PR_NUMBER"
echo "Branch Name: $BRANCH_NAME"
echo "Clean Branch Name: $CLEAN_BRANCH_NAME"

echo "clean_branch_name=$CLEAN_BRANCH_NAME" >> $GITHUB_OUTPUT
echo "pr_number=$PR_NUMBER" >> $GITHUB_OUTPUT

# List and unpublish prerelease versions
- name: Cleanup prerelease versions
run: |
CLEAN_BRANCH_NAME="${{ steps.pr_info.outputs.clean_branch_name }}"

echo "Cleaning up prerelease versions for branch: $CLEAN_BRANCH_NAME"

# List all versions with the branch tag
echo "Listing versions with tag: $CLEAN_BRANCH_NAME"
npm view @elliottech/react-native-kline-view@$CLEAN_BRANCH_NAME || echo "No versions found with tag $CLEAN_BRANCH_NAME"

# Note: npm unpublish by tag is not reliable, so we'll list what would be cleaned up
echo "Note: npm unpublish by tag is not reliable"
echo "Manual cleanup may be needed for tag: $CLEAN_BRANCH_NAME"

# Also try to unpublish specific prerelease versions that might exist
# Get current version from package.json to construct prerelease version
CURRENT_VERSION=$(node -p "require('./package.json').version")
PRERELEASE_VERSION="${CURRENT_VERSION}-${CLEAN_BRANCH_NAME}.${{ steps.pr_info.outputs.pr_number }}"

echo "Attempting to unpublish specific version: $PRERELEASE_VERSION"
npm unpublish @elliottech/react-native-kline-view@$PRERELEASE_VERSION || echo "Version $PRERELEASE_VERSION not found or already unpublished"

echo "Cleanup completed for branch: $CLEAN_BRANCH_NAME"
env:
NODE_AUTH_TOKEN: ${{ secrets.GH_PACKAGE_TOKEN }}

# Comment on the merged PR
- name: Comment on merged PR
uses: actions/github-script@v7
with:
script: |
const cleanBranchName = '${{ steps.pr_info.outputs.clean_branch_name }}';
const prNumber = ${{ steps.pr_info.outputs.pr_number }};

const comment = `## 🧹 Prerelease Cleanup Complete

All prerelease versions for branch \`${cleanBranchName}\` have been cleaned up.

The following actions were performed:
- ✅ Unpublished all versions tagged with \`${cleanBranchName}\`
- ✅ Removed prerelease packages from npm registry

---
*This cleanup was performed automatically after PR merge.*`;

await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: prNumber,
body: comment
});
84 changes: 84 additions & 0 deletions .github/workflows/manual-cleanup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Manual Prerelease Cleanup

on:
workflow_dispatch:
inputs:
branch_name:
description: 'Branch name to clean up (without special characters)'
required: true
type: string
pr_number:
description: 'PR number (optional, for specific version cleanup)'
required: false
type: string

jobs:
manual-cleanup:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}

- name: Set NPM_TOKEN for GitHub Packages
run: echo "NPM_TOKEN=${{ secrets.GH_PACKAGE_TOKEN }}" >> $GITHUB_ENV

# Setup Node.js and npm
- uses: actions/setup-node@v4
with:
node-version: "22.19.0"
registry-url: 'https://npm.pkg.github.com'
scope: '@elliottech'

# Clean branch name
- name: Clean branch name
id: clean_name
run: |
BRANCH_NAME="${{ github.event.inputs.branch_name }}"
CLEAN_BRANCH_NAME=$(echo "$BRANCH_NAME" | sed 's/[^a-zA-Z0-9-]/-/g' | sed 's/--*/-/g' | sed 's/^-\|-$//g')
echo "Original branch name: $BRANCH_NAME"
echo "Clean branch name: $CLEAN_BRANCH_NAME"
echo "clean_branch_name=$CLEAN_BRANCH_NAME" >> $GITHUB_OUTPUT

# List and cleanup prerelease versions
- name: List and cleanup prerelease versions
run: |
CLEAN_BRANCH_NAME="${{ steps.clean_name.outputs.clean_branch_name }}"
PR_NUMBER="${{ github.event.inputs.pr_number }}"

echo "Cleaning up prerelease versions for branch: $CLEAN_BRANCH_NAME"

# List all versions with the branch tag
echo "=== Listing versions with tag: $CLEAN_BRANCH_NAME ==="
npm view @elliottech/react-native-kline-view@$CLEAN_BRANCH_NAME || echo "No versions found with tag $CLEAN_BRANCH_NAME"

# Unpublish all versions with this tag
echo "=== Unpublishing versions with tag: $CLEAN_BRANCH_NAME ==="
npm unpublish @elliottech/react-native-kline-view@$CLEAN_BRANCH_NAME || echo "No versions to unpublish with tag $CLEAN_BRANCH_NAME"

# If PR number is provided, also try to unpublish specific version
if [ -n "$PR_NUMBER" ]; then
CURRENT_VERSION=$(node -p "require('./package.json').version")
PRERELEASE_VERSION="${CURRENT_VERSION}-${CLEAN_BRANCH_NAME}.${PR_NUMBER}"

echo "=== Attempting to unpublish specific version: $PRERELEASE_VERSION ==="
npm unpublish @elliottech/react-native-kline-view@$PRERELEASE_VERSION || echo "Version $PRERELEASE_VERSION not found or already unpublished"
fi

echo "=== Cleanup completed for branch: $CLEAN_BRANCH_NAME ==="
env:
NODE_AUTH_TOKEN: ${{ secrets.GH_PACKAGE_TOKEN }}

# Show cleanup summary
- name: Show cleanup summary
run: |
echo "## 🧹 Manual Cleanup Summary"
echo "**Branch:** ${{ github.event.inputs.branch_name }}"
echo "**Clean Branch Name:** ${{ steps.clean_name.outputs.clean_branch_name }}"
echo "**PR Number:** ${{ github.event.inputs.pr_number || 'Not specified' }}"
echo ""
echo "✅ Cleanup completed successfully!"
Loading