react-native-insider 7.0.10 → 7.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-insider",
3
- "version": "7.0.10",
3
+ "version": "7.0.11",
4
4
  "description": "React Native Insider SDK",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -1,40 +0,0 @@
1
- ---
2
- description: Generate PR description using project template
3
- argument-hint: "[base-branch]"
4
- ---
5
-
6
- Generate a PR description using the template in .github/pull_request_template.md file.
7
-
8
- If the user provided a base branch argument, use that: $1
9
- Otherwise, automatically detect the base branch by:
10
- 1. First checking if there's an upstream branch set
11
- 2. If not, use the default main branch (develop, main, or master)
12
-
13
- Compare the current branch against this base branch.
14
-
15
- Requirements:
16
- - Write the description as markdown text
17
- - This is a React Native SDK project with iOS (Objective-C) and Android (Java) native modules
18
- - Highlight code elements (classes, methods, imports, etc.) using backticks
19
- - Never mention classes with full paths, just wrap class names with backticks (e.g., `InsiderIdentifier` not `src/InsiderIdentifier.js`)
20
- - For native code references, use simple class names: `RNInsider` (not `ios/RNInsider/RNInsider.m`) or `RNInsiderModule` (not `android/src/main/java/com/useinsider/react/RNInsiderModule.java`)
21
- - If the current branch name contains the format "MOB-[0-9]+" (e.g., feature/MOB-1234), extract the ticket number and create a JIRA URL: https://winsider.atlassian.net/browse/MOB-XXXX
22
- - Include manual testing recommendations in the test cases section of the template
23
- - Keep it high-level and avoid getting into too much technical detail
24
- - Focus on what changed and why, not the implementation details
25
- - When describing changes, specify if they affect iOS, Android, or both platforms
26
-
27
- Output Format:
28
- - **IMPORTANT**: Wrap the entire PR description in a markdown code block using triple backticks (```markdown ... ```)
29
- - This allows the user to easily copy the raw markdown without formatting issues
30
- - The output should be a single markdown code block containing all the PR description content
31
-
32
- Steps:
33
- 1. Read the PR template from .github/pull_request_template.md
34
- 2. Get the git diff comparing current branch against the base branch
35
- 3. Get the commit history for context
36
- 4. Extract the JIRA ticket number from the branch name if present
37
- 5. Analyze the changes across iOS, Android, and JavaScript/TypeScript code
38
- 6. Identify which platform(s) are affected (iOS, Android, or both)
39
- 7. Generate a clear, concise PR description following the template format
40
- 8. Wrap the entire output in a ```markdown code block for easy copying
@@ -1,34 +0,0 @@
1
- {
2
- "permissions": {
3
- "allow": [
4
- "Bash(git:*)",
5
- "Bash(npm run:*)",
6
- "Edit(ios/**)",
7
- "Edit(index.d.ts)",
8
- "Edit(index.js)",
9
- "Edit(src/**)",
10
- "Edit(android/**)",
11
- "Read(.github/**)",
12
- "Read(.claude/**)",
13
- "WebSearch",
14
- "WebFetch(domain:academy.insiderone.com)"
15
- ],
16
- "deny": [
17
- "Bash(sudo:*)",
18
- "Bash(curl:*)",
19
- "Bash(wget:*)",
20
- "Bash(fetch:*)",
21
- "Bash(git push:*)",
22
- "Bash(git push --force:*)",
23
- "Read(./.env*)",
24
- "Read(./secrets/**)",
25
- "Read(./config/credentials.json)"
26
- ],
27
- "ask": [
28
- "Bash(pod install:*)",
29
- "Bash(pod update:*)",
30
- "Bash(rm:*)",
31
- "Bash(git commit:*)"
32
- ]
33
- }
34
- }
@@ -1,57 +0,0 @@
1
- # Git Hooks
2
-
3
- ## 📌 Purpose
4
- This directory uses Git hooks to enforce standards and automate tasks during the development workflow.
5
- The main example included is a **`commit-msg`** hook that enforces [Conventional Commits v1.0.0](https://www.conventionalcommits.org/en/v1.0.0/) rules with additional project-specific logic.
6
-
7
- ---
8
-
9
- ## 📂 Hooks Included
10
-
11
- ### 1. `commit-msg`
12
- Ensures commit messages follow the Conventional Commits specification, with custom rules:
13
-
14
- - **Bypasses**:
15
- - `Merge branch ...` commits (merge commits)
16
- - `pick ...`, `reword ...`, `edit ...`, `squash ...`, `fixup ...`, `exec ...` messages (interactive rebase auto-generated commits)
17
- - **JIRA Reference**:
18
- - If the branch name contains a JIRA ID in the form `MOB-1234`, it will automatically append
19
- `#Ref: MOB-1234` to the end of the commit message (if not already present).
20
- - **Optional Description**:
21
- - `<type>[<scope>][!]: <description>` — the description can be empty.
22
- - **Header length**:
23
- - Max 120 characters (hard limit)
24
- - Warning if over 50 or 72 characters.
25
-
26
-
27
- ### 2. `pre-push`
28
-
29
- Prevents developers from pushing to any branch that ends with *-nh if any Gradle file in the project contains Huawei-related dependencies or repositories.
30
-
31
- - **What it checks for**:
32
- - com.huawei.hms (HMS SDK)
33
- - com.huawei.agconnect (AG Connect SDK)
34
- - developer.huawei.com/repo (Huawei Maven repository)
35
-
36
- The purpose of this rule is to ensure that non-huawei (-nh) branches remain clean of Huawei dependencies.
37
-
38
- - **How it works**:
39
- - Runs only on branches whose names end with `-nh`.
40
- - Lists all tracked Gradle files (`*.gradle`, `*.gradle.kts`) in the repository once and scans their contents for the above patterns.
41
- - If any match is found, the push is blocked with a short message.
42
-
43
- You can temporarily skip the check with `git push --no-verify` (not recommended).
44
-
45
- ## 🔧 Installation
46
-
47
- ### 1. Copy Hooks to `.git/hooks/`
48
-
49
- Run the following commands under project's directory:
50
-
51
- ```bash
52
- cp .git-hooks/commit-msg .git/hooks/commit-msg
53
- chmod +x .git/hooks/commit-msg
54
-
55
- cp .git-hooks/pre-push .git/hooks/pre-push
56
- chmod +x .git/hooks/pre-push
57
- ```
@@ -1,83 +0,0 @@
1
- #!/bin/sh
2
-
3
- COMMIT_MSG_FILE="$1"
4
- COMMIT_MSG_FIRST_LINE=$(head -n1 "$COMMIT_MSG_FILE")
5
-
6
- # 1. Skip "Merge branch ..." commits
7
- if echo "$COMMIT_MSG_FIRST_LINE" | grep -qE "^Merge branch "; then
8
- exit 0
9
- fi
10
-
11
- # 2. Skip interactive rebase auto-commits
12
- if echo "$COMMIT_MSG_FIRST_LINE" | grep -qE "^(pick|reword|edit|squash|fixup|exec) "; then
13
- exit 0
14
- fi
15
-
16
- # Allowed Conventional Commit types (v1.0.0 + release)
17
- ALLOWED_TYPES="feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert|release"
18
-
19
- # Regex – type(scope)!?: description (description required)
20
- FIRST_LINE_REGEX="^(${ALLOWED_TYPES})(\([^\)]+\))?(!)?: [^ ].+$"
21
-
22
- error() {
23
- echo "⛔ Error: $1"
24
- }
25
-
26
- warn() {
27
- echo "⚠️ Warning: $1"
28
- }
29
-
30
- # 3. Validate header format
31
- if ! echo "$COMMIT_MSG_FIRST_LINE" | grep -qE "${FIRST_LINE_REGEX}"; then
32
- error "Commit mesajı başlığı Conventional Commits v1.0.0 formatına uymuyor."
33
- echo "Mevcut mesaj: \"$COMMIT_MSG_FIRST_LINE\""
34
- echo ""
35
- echo "Beklenen format: <tip>[<scope>][!]: <açıklama>"
36
- echo "Geçerli tipler: ${ALLOWED_TYPES}"
37
- exit 1
38
- fi
39
-
40
- # 4. Header length check (max 120 chars)
41
- HEADER_LENGTH=${#COMMIT_MSG_FIRST_LINE}
42
- if [ "$HEADER_LENGTH" -gt 120 ]; then
43
- error "İlk satır 120 karakteri aşıyor. (Mevcut uzunluk: $HEADER_LENGTH)"
44
- exit 1
45
- elif [ "$HEADER_LENGTH" -gt 72 ]; then
46
- warn "İlk satır 72 karakterden uzun. (Mevcut uzunluk: $HEADER_LENGTH)"
47
- fi
48
-
49
- # 5. Body check (optional)
50
- LINE_NO=0
51
- while IFS= read -r line; do
52
- LINE_NO=$((LINE_NO + 1))
53
- # Second line should be empty if body exists
54
- if [ "$LINE_NO" -eq 2 ] && [ -n "$line" ]; then
55
- warn "İkinci satır boş olmalı (body varsa)."
56
- fi
57
- done < "$COMMIT_MSG_FILE"
58
-
59
- # 6. BREAKING CHANGE footer check
60
- if grep -qE '^BREAKING CHANGE: ' "$COMMIT_MSG_FILE"; then
61
- if ! grep -qE '^BREAKING CHANGE: .{1,}' "$COMMIT_MSG_FILE"; then
62
- error "BREAKING CHANGE açıklaması boş olamaz."
63
- exit 1
64
- fi
65
- fi
66
-
67
- # 7. Append JIRA ID from branch name
68
- BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD)
69
- JIRA_ID=$(echo "$BRANCH_NAME" | grep -oE 'MOB-[0-9]+')
70
-
71
- if [ -n "$JIRA_ID" ]; then
72
- if ! grep -q "$JIRA_ID" "$COMMIT_MSG_FILE"; then
73
- {
74
- echo ""
75
- echo "#Ref: $JIRA_ID"
76
- } >> "$COMMIT_MSG_FILE"
77
- echo "ℹ️ Task ID referans olarak eklendi: $JIRA_ID"
78
- fi
79
- fi
80
-
81
- echo "✅ Commit mesajı Conventional Commits v1.0.0 kurallarına uygun."
82
- exit 0
83
-
@@ -1,25 +0,0 @@
1
- #!/usr/bin/env bash
2
-
3
- set -euo pipefail
4
-
5
- CURRENT_BRANCH="$(git rev-parse --abbrev-ref HEAD 2>/dev/null || echo "")"
6
- if [ -z "${CURRENT_BRANCH}" ] || [ "${CURRENT_BRANCH}" = "HEAD" ]; then
7
- exit 0
8
- fi
9
-
10
- if [ -z "$(git ls-files -- '*.gradle' '*.gradle.kts' || true)" ]; then
11
- exit 0
12
- fi
13
-
14
- if [[ "${CURRENT_BRANCH}" == *-nh ]]; then
15
- if git ls-files -z -- '*.gradle' '*.gradle.kts' \
16
- | xargs -0 grep -qiE \
17
- -e 'com\.huawei\.hms' \
18
- -e 'com\.huawei\.agconnect' \
19
- -e '(^|[^A-Za-z0-9_])agconnect([^A-Za-z0-9_]|$)' \
20
- -e 'developer\.huawei\.com/repo'
21
- then
22
- echo "⛔ Error: ${CURRENT_BRANCH} dalını gönderemezsiniz çünkü Huawei referansı Gradle dosyalarında mevcut."
23
- exit 1
24
- fi
25
- fi
@@ -1,258 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
-
4
- usage() {
5
- cat <<EOF
6
- Kullanım: $(basename "$0") --repository <repository> --version <version> [opsiyonlar]
7
-
8
- Zorunlu:
9
- -r, --repository <git-repository>
10
- -v, --version <release-version>
11
-
12
- Opsiyonel:
13
- -t, --task <jira-task> (tekrar verilebilir)
14
- -b, --branch <branch-name> (tekrar verilebilir)
15
- --is-nh (NH versiyonu için)
16
-
17
- Örnekler:
18
- $(basename "$0") --repository react-native-insider --version 7.1.0 --task MOB-1234 --task MOB-2345
19
- $(basename "$0") --repository react-native-insider --version 7.1.0 --branch feature/MOB-123 --branch epic/webview
20
- $(basename "$0") --repository react-native-insider --version 7.1.0-nh --is-nh --task MOB-1234
21
- EOF
22
- }
23
-
24
- TASKS=()
25
- GIT_REPOSITORY=""
26
- GIT_BRANCHES=()
27
- GIT_TARGET_BRANCH="develop"
28
- GIT_BASE_BRANCH="master"
29
- GIT_PULL_REQUESTS=()
30
- RELEASE_VERSION=""
31
- IS_NH="false"
32
-
33
- while [[ $# -gt 0 ]]; do
34
- case "$1" in
35
- -r|--repository) GIT_REPOSITORY="$2"; shift 2;;
36
- -v|--version) RELEASE_VERSION="$2"; shift 2;;
37
- -t|--task) TASKS+=("$2"); shift 2;;
38
- -b|--branch) GIT_BRANCHES+=("$2"); shift 2;;
39
- --is-nh) IS_NH="true"; shift;;
40
- -h|--help) usage; exit 0;;
41
- *) echo "⛔ Error: Bilinmeyen argüman: $1"; usage; exit 1;;
42
- esac
43
- done
44
-
45
- if [[ -z "${GIT_REPOSITORY}" || -z "${RELEASE_VERSION}" ]]; then
46
- echo "⛔ Error: --repository ve --version zorunludur."
47
- usage; exit 1
48
- fi
49
-
50
- # NH version kontrolü
51
- if [[ "${IS_NH}" == "true" ]]; then
52
- GIT_TARGET_BRANCH="develop-nh"
53
- GIT_BASE_BRANCH="master-nh"
54
- if [[ ! "${RELEASE_VERSION}" == *-nh ]]; then
55
- echo "⚠️ Warning: NH versiyonu için version '-nh' suffix'i ile bitmeli. Otomatik ekleniyor..."
56
- RELEASE_VERSION="${RELEASE_VERSION}-nh"
57
- fi
58
- elif [[ "${RELEASE_VERSION}" == *-nh ]]; then
59
- echo "⚠️ Warning: Version '-nh' ile bitiyor ama --is-nh flag'i verilmemiş. IS_NH=true olarak ayarlanıyor..."
60
- IS_NH="true"
61
- GIT_TARGET_BRANCH="develop-nh"
62
- GIT_BASE_BRANCH="master-nh"
63
- fi
64
-
65
- echo "ℹ️ Project: $(git rev-parse --show-toplevel)"
66
- echo "ℹ️ Target Branch: ${GIT_TARGET_BRANCH}"
67
- echo "ℹ️ Base Branch: ${GIT_BASE_BRANCH}"
68
- echo "ℹ️ Release Version: ${RELEASE_VERSION}"
69
-
70
- # JIRA task'lardan branch'leri bul
71
- if [[ ${#TASKS[@]} -gt 0 ]]; then
72
- for task in "${TASKS[@]}"; do
73
- echo "🔍 JIRA'dan talep edildi: ${task}"
74
- response="$(acli jira workitem view "${task}" --fields summary,customfield_14159 --json)"
75
- summary="$(jq -r '.fields.summary' <<< "${response}")"
76
- while IFS=' ' read -r url; do
77
- read owner repository pullRequest <<< "$(
78
- sed -E 's#.*github.com/([^/]+)/([^/]+)/pull/([0-9]+).*#\1 \2 \3#' <<< "${url}"
79
- )"
80
- if [[ "${repository}" != "${GIT_REPOSITORY}" ]]; then
81
- echo "⚠️ Warning: Branch bulunamadı: ${repository} (beklenen: ${GIT_REPOSITORY})"
82
- else
83
- branch=$(gh pr view "${pullRequest}" --repo "${owner}/${repository}" \
84
- --json headRefName --jq .headRefName)
85
- GIT_BRANCHES+=("$branch")
86
- GIT_PULL_REQUESTS+=("$url")
87
- echo "✅ Branch <${branch}> ${summary}"
88
- fi
89
- done < <(
90
- jq -r '.fields.customfield_14159.content[].content[]?.marks[]?.attrs.href // empty' <<< "${response}" \
91
- | sed -E 's#/files$##' \
92
- | grep -E 'github\.com/.+/pull/[0-9]+'
93
- )
94
- done
95
- fi
96
-
97
- # Octopus merge stratejisi (parallel merge)
98
- octopus_merge() {
99
- local dry_run="${3:-true}"
100
- local working_directory="$(git rev-parse --show-toplevel)"
101
- local target_branch="${1}"
102
- local -a source_branches=()
103
- read -r -a source_branches <<< "${2//,/ }"
104
- if [[ "${dry_run}" == "true" ]]; then
105
- working_directory="$(mktemp -d)"
106
- git worktree add --detach "${working_directory}" "origin/${target_branch}" >/dev/null
107
- trap "git worktree remove --force '${working_directory}' 2>/dev/null || true" RETURN
108
- git -C "${working_directory}" fetch --prune --tags origin +refs/heads/*:refs/remotes/origin/*
109
- git -C "${working_directory}" checkout --detach "refs/remotes/origin/${target_branch}" >/dev/null
110
- fi
111
- echo "🐙 Birleştirilecek (parallel): ${source_branches[*]} → ${working_directory}"
112
- echo "🐙 Birleştiriliyor... ${source_branches[*]}"
113
- if [[ "${dry_run}" == "true" ]]; then
114
- if git -C "${working_directory}" merge --no-ff --no-commit "${source_branches[@]/#/origin/}" ; then
115
- echo "✅ Birleştirildi: ${source_branches[*]}"
116
- git -C "${working_directory}" merge --abort 2>/dev/null; return 0
117
- else
118
- echo "⛔ Error: Birleştirme başarısız: ${source_branches[*]}"
119
- git -C "${working_directory}" merge --abort 2>/dev/null; return 1
120
- fi
121
- else
122
- git -C "${working_directory}" merge --no-ff "${source_branches[@]/#/origin/}" \
123
- --message "Merge branch ${source_branches[*]} into ${target_branch}"
124
- fi
125
- }
126
-
127
- # Sequential merge stratejisi (sıralı merge)
128
- sequential_merge() {
129
- local dry_run="${3:-true}"
130
- local working_directory="$(git rev-parse --show-toplevel)"
131
- local target_branch="${1}"
132
- local -a source_branches=()
133
- read -r -a source_branches <<< "${2//,/ }"
134
- if [[ "${dry_run}" == "true" ]]; then
135
- working_directory="$(mktemp -d)"
136
- git worktree add --detach "${working_directory}" "origin/${target_branch}" >/dev/null
137
- trap "git worktree remove --force '${working_directory}' 2>/dev/null || true" RETURN
138
- git -C "${working_directory}" fetch --prune --tags origin +refs/heads/*:refs/remotes/origin/*
139
- git -C "${working_directory}" checkout --detach "refs/remotes/origin/${target_branch}" >/dev/null
140
- fi
141
- echo "➡️ Birleştirilecek (sequential): ${source_branches[*]} → ${working_directory}"
142
- local -a merged_branches=()
143
- local -a pending_branches=("${source_branches[@]}")
144
- local changed=1
145
- while (( changed > 0)) && (( ${#pending_branches[@]} > 0 )); do
146
- changed=0
147
- local -a next_pending=()
148
- for branch in "${pending_branches[@]}"; do
149
- echo "➡️ Birleştiriliyor... ${branch}"
150
- if [[ "${dry_run}" == "true" ]]; then
151
- if git -C "${working_directory}" merge --no-ff --no-commit "origin/${branch}" >/dev/null; then
152
- git -C "${working_directory}" commit --no-edit
153
- merged_branches+=("${branch}"); changed=1
154
- echo "✅ Birleştirildi: ${branch}"
155
- else
156
- git -C "${working_directory}" merge --abort 2>/dev/null
157
- next_pending+=("${branch}")
158
- echo "⛔ Error: Birleştirme başarısız: ${branch}"
159
- fi
160
- else
161
- git -C "${working_directory}" merge --no-ff "origin/${branch}" \
162
- --message "Merge branch ${branch} into ${target_branch}"
163
- merged_branches+=("${branch}"); changed=1
164
- echo "✅ Birleştirildi: ${branch}"
165
- fi
166
- done
167
- if (( ${#next_pending[@]} > 0 )); then
168
- pending_branches=("${next_pending[@]-}")
169
- else
170
- changed=0; pending_branches=()
171
- fi
172
- done
173
- if [[ "${dry_run}" == "true" ]]; then
174
- git -C "${working_directory}" merge --abort 2>/dev/null
175
- fi
176
- return $(( ${#pending_branches[@]} == 0 ? 0 : 1 ))
177
- }
178
-
179
- if [[ ${#GIT_BRANCHES[@]} -eq 0 ]]; then
180
- echo "⚠️ Warning: Birleştirilecek branch yok, sadece release oluşturulacak."
181
- else
182
- # Merge stratejisini belirle (dry-run ile test et)
183
- MERGE_STRATEGY=""
184
- if octopus_merge "${GIT_TARGET_BRANCH}" "${GIT_BRANCHES[*]}" "true"; then
185
- MERGE_STRATEGY="parallel"
186
- else
187
- echo "⚠️ Warning: Parallel merge başarısız, sequential merge deneniyor..."
188
- if sequential_merge "${GIT_TARGET_BRANCH}" "${GIT_BRANCHES[*]}" "true"; then
189
- MERGE_STRATEGY="sequential"
190
- else
191
- echo "⛔ Error: Merge işlemi başarısız, çıkılıyor."
192
- exit 1
193
- fi
194
- fi
195
- echo "ℹ️ Merge için belirlenen strateji: ${MERGE_STRATEGY}"
196
- fi
197
-
198
- # Git hazırlık
199
- git fetch --all --prune || true
200
- git clean -fdx || true
201
-
202
- # Target branch'e geç
203
- if git rev-parse --verify "refs/heads/${GIT_TARGET_BRANCH}" >/dev/null 2>&1; then
204
- git switch "${GIT_TARGET_BRANCH}"
205
- else
206
- git switch --track -c "${GIT_TARGET_BRANCH}" "origin/${GIT_TARGET_BRANCH}"
207
- fi
208
-
209
- git reset --hard "origin/${GIT_TARGET_BRANCH}"
210
-
211
- if [[ ${#GIT_BRANCHES[@]} -eq 0 ]]; then
212
- echo "⚠️ Warning: Birleştirilecek branch yok, sadece release oluşturulacak."
213
- else
214
- # Merge işlemini gerçekleştir
215
- echo "ℹ️ Merge ediliyor... (${MERGE_STRATEGY})"
216
- if [[ "${MERGE_STRATEGY}" == "parallel" ]]; then
217
- octopus_merge "${GIT_TARGET_BRANCH}" "${GIT_BRANCHES[*]}" "false"
218
- else
219
- sequential_merge "${GIT_TARGET_BRANCH}" "${GIT_BRANCHES[*]}" "false"
220
- fi
221
- fi
222
-
223
- # Target branch'i push et
224
- echo "ℹ️ Branch <${GIT_TARGET_BRANCH}> gönderiliyor..."
225
- git push origin "${GIT_TARGET_BRANCH}"
226
-
227
- # Release branch oluştur
228
- GIT_RELEASE_BRANCH="release/${RELEASE_VERSION}"
229
-
230
- echo "ℹ️ Release oluşturuluyor: ${GIT_TARGET_BRANCH} → ${GIT_RELEASE_BRANCH}"
231
-
232
- git switch -c "${GIT_RELEASE_BRANCH}" "${GIT_TARGET_BRANCH}"
233
- if ! git log --oneline "origin/${GIT_BASE_BRANCH}..${GIT_RELEASE_BRANCH}" | grep -q .; then
234
- git commit -S --allow-empty -m "chore: create release branch ${GIT_RELEASE_BRANCH}"
235
- fi
236
- git push -u origin "${GIT_RELEASE_BRANCH}"
237
-
238
- # Pull Request oluştur
239
- echo "ℹ️ Pull Request yaratılıyor: ${GIT_BASE_BRANCH} ← ${GIT_RELEASE_BRANCH}"
240
-
241
- printf -v GIT_PULL_REQUEST_BODY 'Automated release: `%s`\n\n' "${GIT_RELEASE_BRANCH}"
242
- if [[ ${#GIT_PULL_REQUESTS[@]} -gt 0 ]]; then
243
- for pullRequest in "${GIT_PULL_REQUESTS[@]}"; do
244
- # Extract PR number from URL: https://github.com/owner/repo/pull/123 -> #123
245
- prNumber=$(sed -E 's#.*/pull/([0-9]+).*#\1#' <<< "${pullRequest}")
246
- printf -v GIT_PULL_REQUEST_BODY '%s- [#%s](%s)\n' "${GIT_PULL_REQUEST_BODY}" "${prNumber}" "${pullRequest}"
247
- done
248
- fi
249
-
250
- gh pr create \
251
- --repo "useinsider/${GIT_REPOSITORY}" \
252
- --base "${GIT_BASE_BRANCH}" \
253
- --head "${GIT_RELEASE_BRANCH}" \
254
- --title "Release ${RELEASE_VERSION}" \
255
- --body "${GIT_PULL_REQUEST_BODY}" \
256
- --assignee "insider-automation"
257
-
258
- echo "✅ Pull Request yaratıldı: ${GIT_RELEASE_BRANCH}"
@@ -1,275 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
-
4
- usage() {
5
- cat <<EOF
6
- Kullanım: $(basename "$0") [opsiyonlar]
7
-
8
- Opsiyonel:
9
- --previous-version <version> Önceki RN version (belirtilmezse git'ten bulunur)
10
- --current-version <version> Güncel RN version (belirtilmezse package.json'dan alınır)
11
-
12
- Örnekler:
13
- $(basename "$0")
14
- $(basename "$0") --previous-version 7.0.0 --current-version 7.1.0
15
- EOF
16
- }
17
-
18
- PREVIOUS_VERSION=""
19
- CURRENT_VERSION=""
20
-
21
- while [[ $# -gt 0 ]]; do
22
- case "$1" in
23
- --previous-version) PREVIOUS_VERSION="$2"; shift 2;;
24
- --current-version) CURRENT_VERSION="$2"; shift 2;;
25
- -h|--help) usage; exit 0;;
26
- *) echo "⛔ Error: Bilinmeyen argüman: $1" >&2; usage; exit 1;;
27
- esac
28
- done
29
-
30
- PROJECT_ROOT="$(git rev-parse --show-toplevel 2>/dev/null || pwd)"
31
- PACKAGE_FILE="${PROJECT_ROOT}/package.json"
32
- PODSPEC_FILE="${PROJECT_ROOT}/RNInsider.podspec"
33
- GRADLE_FILE="${PROJECT_ROOT}/android/build.gradle"
34
-
35
- # Güncel versiyonu al
36
- if [[ -z "${CURRENT_VERSION}" ]]; then
37
- CURRENT_VERSION="$(sed -nE 's/^[[:space:]]*"version"[[:space:]]*:[[:space:]]*"([^"]+)".*/\1/p' "${PACKAGE_FILE}" | head -n1)"
38
- fi
39
-
40
- # Önceki versiyonu al (git tag'lerden)
41
- if [[ -z "${PREVIOUS_VERSION}" ]]; then
42
- # NH olmayan en son tag'i bul
43
- PREVIOUS_VERSION="$(git tag --sort=-version:refname | grep -v '\-nh$' | grep -E '^[0-9]+\.[0-9]+\.[0-9]+$' | head -n2 | tail -n1 || echo "")"
44
- if [[ -z "${PREVIOUS_VERSION}" ]]; then
45
- echo "⚠️ Warning: Önceki versiyon bulunamadı, native SDK notes oluşturulamayacak." >&2
46
- exit 0
47
- fi
48
- fi
49
-
50
- echo "ℹ️ Önceki RN Versiyon: ${PREVIOUS_VERSION}" >&2
51
- echo "ℹ️ Güncel RN Versiyon: ${CURRENT_VERSION}" >&2
52
-
53
- # Önceki versiyon için native SDK versiyonlarını al (git checkout ile)
54
- get_previous_native_versions() {
55
- local version=$1
56
- local temp_dir="$(mktemp -d)"
57
- trap "rm -rf '${temp_dir}'" RETURN
58
-
59
- # Önceki versiyonu checkout et
60
- git archive "${version}" | tar -x -C "${temp_dir}" 2>/dev/null || return 1
61
-
62
- # Android versiyonlarını al
63
- PREV_ANDROID_INSIDER="$(sed -nE 's/^[[:space:]]*(implementation|api|compileOnly|runtimeOnly)[[:space:]]+['\''"]com\.useinsider:insider:([^'\''"]+)['\''"]/\2/p' "${temp_dir}/android/build.gradle" | head -n1 || echo "")"
64
- PREV_ANDROID_HYBRID="$(sed -nE 's/^[[:space:]]*(implementation|api|compileOnly|runtimeOnly)[[:space:]]+['\''"]com\.useinsider:insiderhybrid:([^'\''"]+)['\''"]/\2/p' "${temp_dir}/android/build.gradle" | head -n1 || echo "")"
65
-
66
- # iOS versiyonlarını al
67
- PREV_IOS_MOBILE="$(sed -nE "s/^[[:space:]]*s\.dependency[[:space:]]*['\"]InsiderMobile['\"][[:space:]]*,[[:space:]]*['\"]([^'\"#]+)['\"]/\1/p" "${temp_dir}/RNInsider.podspec" | head -n1 || echo "")"
68
- PREV_IOS_GEOFENCE="$(sed -nE "s/^[[:space:]]*s\.dependency[[:space:]]*['\"]InsiderGeofence['\"][[:space:]]*,[[:space:]]*['\"]([^'\"#]+)['\"]/\1/p" "${temp_dir}/RNInsider.podspec" | head -n1 || echo "")"
69
- PREV_IOS_HYBRID="$(sed -nE "s/^[[:space:]]*s\.dependency[[:space:]]*['\"]InsiderHybrid['\"][[:space:]]*,[[:space:]]*['\"]([^'\"#]+)['\"]/\1/p" "${temp_dir}/RNInsider.podspec" | head -n1 || echo "")"
70
- }
71
-
72
- # Güncel native SDK versiyonlarını al
73
- CURR_ANDROID_INSIDER="$(sed -nE 's/^[[:space:]]*(implementation|api|compileOnly|runtimeOnly)[[:space:]]+['\''"]com\.useinsider:insider:([^'\''"]+)['\''"]/\2/p' "${GRADLE_FILE}" | head -n1 || echo "")"
74
- CURR_ANDROID_HYBRID="$(sed -nE 's/^[[:space:]]*(implementation|api|compileOnly|runtimeOnly)[[:space:]]+['\''"]com\.useinsider:insiderhybrid:([^'\''"]+)['\''"]/\2/p' "${GRADLE_FILE}" | head -n1 || echo "")"
75
-
76
- CURR_IOS_MOBILE="$(sed -nE "s/^[[:space:]]*s\.dependency[[:space:]]*['\"]InsiderMobile['\"][[:space:]]*,[[:space:]]*['\"]([^'\"#]+)['\"]/\1/p" "${PODSPEC_FILE}" | head -n1 || echo "")"
77
- CURR_IOS_GEOFENCE="$(sed -nE "s/^[[:space:]]*s\.dependency[[:space:]]*['\"]InsiderGeofence['\"][[:space:]]*,[[:space:]]*['\"]([^'\"#]+)['\"]/\1/p" "${PODSPEC_FILE}" | head -n1 || echo "")"
78
- CURR_IOS_HYBRID="$(sed -nE "s/^[[:space:]]*s\.dependency[[:space:]]*['\"]InsiderHybrid['\"][[:space:]]*,[[:space:]]*['\"]([^'\"#]+)['\"]/\1/p" "${PODSPEC_FILE}" | head -n1 || echo "")"
79
-
80
- # Önceki versiyonları al
81
- get_previous_native_versions "${PREVIOUS_VERSION}" || {
82
- echo "⚠️ Warning: Önceki versiyon tag'i bulunamadı, native SDK karşılaştırması yapılamıyor." >&2
83
- exit 0
84
- }
85
-
86
- echo "ℹ️ Android Insider: ${PREV_ANDROID_INSIDER} → ${CURR_ANDROID_INSIDER}" >&2
87
- echo "ℹ️ Android Hybrid: ${PREV_ANDROID_HYBRID} → ${CURR_ANDROID_HYBRID}" >&2
88
- echo "ℹ️ iOS Mobile: ${PREV_IOS_MOBILE} → ${CURR_IOS_MOBILE}" >&2
89
- echo "ℹ️ iOS Geofence: ${PREV_IOS_GEOFENCE} → ${CURR_IOS_GEOFENCE}" >&2
90
- echo "ℹ️ iOS Hybrid: ${PREV_IOS_HYBRID} → ${CURR_IOS_HYBRID}" >&2
91
-
92
- # Android tag'lerini topla
93
- collect_android_tags() {
94
- local prev_version=$1
95
- local curr_version=$2
96
- local module=$3
97
-
98
- if [[ -z "${prev_version}" ]] || [[ -z "${curr_version}" ]]; then
99
- return 0
100
- fi
101
-
102
- # Version aynıysa skip et
103
- if [[ "${prev_version}" == "${curr_version}" ]]; then
104
- return 0
105
- fi
106
-
107
- # mobileandroid repo'sundan tag'leri al
108
- local tags="$(gh api repos/useinsider/mobileandroid/tags --paginate \
109
- | jq -r '.[].name' \
110
- | grep -E "^${module}/[0-9]+\.[0-9]+\.[0-9]+$" \
111
- | sed "s|^${module}/||" \
112
- | sort -V \
113
- || echo "")"
114
-
115
- # Version range'i filtrele
116
- echo "${tags}" | awk -v prev="${prev_version}" -v curr="${curr_version}" '
117
- function version_compare(v1, v2) {
118
- split(v1, a, ".")
119
- split(v2, b, ".")
120
- for (i = 1; i <= 3; i++) {
121
- if (a[i] < b[i]) return -1
122
- if (a[i] > b[i]) return 1
123
- }
124
- return 0
125
- }
126
- {
127
- if (version_compare($1, prev) > 0 && version_compare($1, curr) <= 0) {
128
- print $1
129
- }
130
- }
131
- '
132
- }
133
-
134
- # iOS tag'lerini topla (CocoaPods trunk'tan)
135
- collect_ios_tags() {
136
- local prev_version=$1
137
- local curr_version=$2
138
- local module=$3
139
-
140
- if [[ -z "${prev_version}" ]] || [[ -z "${curr_version}" ]]; then
141
- return 0
142
- fi
143
-
144
- # Version aynıysa skip et
145
- if [[ "${prev_version}" == "${curr_version}" ]]; then
146
- return 0
147
- fi
148
-
149
- # Pod trunk'tan versiyonları al
150
- local versions="$(pod trunk info "${module}" 2>/dev/null \
151
- | sed -nE 's/^[[:space:]]*-[[:space:]]*([^[:space:]]+)[[:space:]]*\(([^)]+)\).*/\2/p' \
152
- | grep -v '\-' \
153
- | sort -V \
154
- || echo "")"
155
-
156
- # Version range'i filtrele
157
- echo "${versions}" | awk -v prev="${prev_version}" -v curr="${curr_version}" '
158
- function version_compare(v1, v2) {
159
- split(v1, a, ".")
160
- split(v2, b, ".")
161
- for (i = 1; i <= 3; i++) {
162
- if (a[i] < b[i]) return -1
163
- if (a[i] > b[i]) return 1
164
- }
165
- return 0
166
- }
167
- {
168
- if (version_compare($1, prev) > 0 && version_compare($1, curr) <= 0) {
169
- print $1
170
- }
171
- }
172
- '
173
- }
174
-
175
- # Release notes başlangıç
176
- echo "## 📦 Native SDK Updates"
177
- echo ""
178
-
179
- HAS_UPDATES="false"
180
-
181
- # Android Insider updates
182
- if [[ -n "${PREV_ANDROID_INSIDER}" ]] && [[ -n "${CURR_ANDROID_INSIDER}" ]] && [[ "${PREV_ANDROID_INSIDER}" != "${CURR_ANDROID_INSIDER}" ]]; then
183
- HAS_UPDATES="true"
184
- echo "### Android SDK Updates (insider: ${PREV_ANDROID_INSIDER} → ${CURR_ANDROID_INSIDER})"
185
- echo ""
186
-
187
- ANDROID_TAGS="$(collect_android_tags "${PREV_ANDROID_INSIDER}" "${CURR_ANDROID_INSIDER}" "insider")"
188
- if [[ -n "${ANDROID_TAGS}" ]]; then
189
- while IFS= read -r tag; do
190
- if [[ -n "${tag}" ]]; then
191
- # GitHub release notes'u al (insider modülü için tag formatı: insider/VERSION)
192
- RELEASE_BODY="$(gh api "repos/useinsider/mobileandroid/releases/tags/insider/${tag}" --jq '.body' 2>/dev/null || echo "")"
193
- if [[ -n "${RELEASE_BODY}" ]]; then
194
- echo "#### [${tag}](https://github.com/useinsider/mobileandroid/releases/tag/insider/${tag})"
195
- echo "${RELEASE_BODY}"
196
- echo ""
197
- else
198
- echo "- **${tag}**: [Release Notes](https://github.com/useinsider/mobileandroid/releases/tag/insider/${tag})"
199
- fi
200
- fi
201
- done <<< "${ANDROID_TAGS}"
202
- else
203
- echo "- Updated to version ${CURR_ANDROID_INSIDER}"
204
- echo ""
205
- fi
206
- fi
207
-
208
- # Android Hybrid updates
209
- if [[ -n "${PREV_ANDROID_HYBRID}" ]] && [[ -n "${CURR_ANDROID_HYBRID}" ]] && [[ "${PREV_ANDROID_HYBRID}" != "${CURR_ANDROID_HYBRID}" ]]; then
210
- HAS_UPDATES="true"
211
- echo "### Android SDK Updates (insiderhybrid: ${PREV_ANDROID_HYBRID} → ${CURR_ANDROID_HYBRID})"
212
- echo ""
213
-
214
- ANDROID_HYBRID_TAGS="$(collect_android_tags "${PREV_ANDROID_HYBRID}" "${CURR_ANDROID_HYBRID}" "insiderhybrid")"
215
- if [[ -n "${ANDROID_HYBRID_TAGS}" ]]; then
216
- while IFS= read -r tag; do
217
- if [[ -n "${tag}" ]]; then
218
- RELEASE_BODY="$(gh api "repos/useinsider/mobileandroid/releases/tags/insiderhybrid/${tag}" --jq '.body' 2>/dev/null || echo "")"
219
- if [[ -n "${RELEASE_BODY}" ]]; then
220
- echo "#### [insiderhybrid/${tag}](https://github.com/useinsider/mobileandroid/releases/tag/insiderhybrid/${tag})"
221
- echo "${RELEASE_BODY}"
222
- echo ""
223
- else
224
- echo "- **${tag}**: [Release Notes](https://github.com/useinsider/mobileandroid/releases/tag/insiderhybrid/${tag})"
225
- fi
226
- fi
227
- done <<< "${ANDROID_HYBRID_TAGS}"
228
- else
229
- echo "- Updated to version ${CURR_ANDROID_HYBRID}"
230
- echo ""
231
- fi
232
- fi
233
-
234
- # iOS Mobile updates
235
- if [[ -n "${PREV_IOS_MOBILE}" ]] && [[ -n "${CURR_IOS_MOBILE}" ]] && [[ "${PREV_IOS_MOBILE}" != "${CURR_IOS_MOBILE}" ]]; then
236
- HAS_UPDATES="true"
237
- echo "### iOS SDK Updates (InsiderMobile: ${PREV_IOS_MOBILE} → ${CURR_IOS_MOBILE})"
238
- echo ""
239
-
240
- IOS_MOBILE_TAGS="$(collect_ios_tags "${PREV_IOS_MOBILE}" "${CURR_IOS_MOBILE}" "InsiderMobile")"
241
- if [[ -n "${IOS_MOBILE_TAGS}" ]]; then
242
- while IFS= read -r tag; do
243
- if [[ -n "${tag}" ]]; then
244
- echo "- **${tag}**: [CocoaPods](https://cocoapods.org/pods/InsiderMobile)"
245
- fi
246
- done <<< "${IOS_MOBILE_TAGS}"
247
- echo ""
248
- else
249
- echo "- Updated to version ${CURR_IOS_MOBILE}"
250
- echo ""
251
- fi
252
- fi
253
-
254
- # iOS Geofence updates
255
- if [[ -n "${PREV_IOS_GEOFENCE}" ]] && [[ -n "${CURR_IOS_GEOFENCE}" ]] && [[ "${PREV_IOS_GEOFENCE}" != "${CURR_IOS_GEOFENCE}" ]]; then
256
- HAS_UPDATES="true"
257
- echo "### iOS SDK Updates (InsiderGeofence: ${PREV_IOS_GEOFENCE} → ${CURR_IOS_GEOFENCE})"
258
- echo ""
259
- echo "- Updated to version ${CURR_IOS_GEOFENCE}"
260
- echo ""
261
- fi
262
-
263
- # iOS Hybrid updates
264
- if [[ -n "${PREV_IOS_HYBRID}" ]] && [[ -n "${CURR_IOS_HYBRID}" ]] && [[ "${PREV_IOS_HYBRID}" != "${CURR_IOS_HYBRID}" ]]; then
265
- HAS_UPDATES="true"
266
- echo "### iOS SDK Updates (InsiderHybrid: ${PREV_IOS_HYBRID} → ${CURR_IOS_HYBRID})"
267
- echo ""
268
- echo "- Updated to version ${CURR_IOS_HYBRID}"
269
- echo ""
270
- fi
271
-
272
- if [[ "${HAS_UPDATES}" == "false" ]]; then
273
- echo "No native SDK updates in this release."
274
- echo ""
275
- fi
@@ -1,136 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
-
4
- usage() {
5
- cat <<EOF
6
- Kullanım: $(basename "$0") -p <package> [opsiyonlar]
7
-
8
- Zorunlu:
9
- -p, --package Örn: /path/to/react-native-insider-7.0.2.tgz
10
-
11
- Opsiyonel:
12
- -t, --title <string> Release başlığı (yok ise version kullanılır)
13
- --notes-file <path> Notları dosyadan al (--generate-notes devre dışı)
14
- --no-notes Not ekleme veya oluşturma
15
- --dry-run Komutları yazdır, çalıştırma
16
-
17
- Örnekler:
18
- $(basename "$0") -p /path/to/react-native-insider-7.0.2.tgz --dry-run
19
- $(basename "$0") -p /path/to/react-native-insider-7.0.2.tgz --title "Release 4.0.2" --notes-file /path/to/CHANGELOG.md
20
- EOF
21
- }
22
-
23
- LIBRARY_ZIP=""
24
- DRY_RUN="false"
25
- RELEASE_NOTES_FILE=""
26
- RELEASE_NO_NOTES="false"
27
- RELEASE_TITLE=""
28
-
29
- # Check validity of arguments
30
- while [[ $# -gt 0 ]]; do
31
- case "$1" in
32
- -p|--package) LIBRARY_ZIP="$2"; shift 2;;
33
- -t|--title) RELEASE_TITLE="$2"; shift 2;;
34
- --notes-file) RELEASE_NOTES_FILE="$2"; shift 2;;
35
- --no-notes) RELEASE_NO_NOTES="true"; shift;;
36
- --dry-run) DRY_RUN="true"; shift;;
37
- -h|--help) usage; exit 0;;
38
- *) echo "⛔ Error: Bilinmeyen argüman: $1"; usage; exit 1;;
39
- esac
40
- done
41
-
42
- if [[ -z "${LIBRARY_ZIP}" ]]; then
43
- echo "⛔ Error: --package zorunludur."
44
- usage; exit 1
45
- fi
46
-
47
- # Execute commands directly (no dry-run mode for GitHub releases)
48
- run() {
49
- echo "+ $*"
50
- eval "$@"
51
- }
52
-
53
- PROJECT_ROOT="$(git rev-parse --show-toplevel 2>/dev/null || pwd)"
54
- PACKAGE_FILE_NAME="package.json"
55
- CURRENT_VERSION_NUMBER="$(sed -nE 's/^[[:space:]]*"version"[[:space:]]*:[[:space:]]*"([^"]+)".*/\1/p' "${PROJECT_ROOT}/${PACKAGE_FILE_NAME}" | head -n1)"
56
-
57
- echo "ℹ️ (Github) Güncel versiyon: ${CURRENT_VERSION_NUMBER}"
58
-
59
- IS_NH_VERSION="false"
60
- RELEASE_NAME="${CURRENT_VERSION_NUMBER}"
61
- if [[ "${CURRENT_VERSION_NUMBER}" == *-nh ]]; then
62
- echo "ℹ️ (Github) -nh versiyonu tespit edildi."
63
- IS_NH_VERSION="true"
64
- RELEASE_NAME="${CURRENT_VERSION_NUMBER%-nh}"
65
- fi
66
-
67
- if [[ "${IS_NH_VERSION}" == "false" ]]; then
68
- if gh release view "${RELEASE_NAME}" >/dev/null 2>&1; then
69
- if [[ "${DRY_RUN}" == "false" ]]; then
70
- echo "⛔ (Github) Error: Bu version halihazırda mevcut: ${RELEASE_NAME}"
71
- exit 1
72
- else
73
- echo "⚠️ (Github) Warning: Bu version halihazırda mevcut: ${RELEASE_NAME} (dry-run modunda atlanıyor.)"
74
- fi
75
- fi
76
- else
77
- if gh release view "${RELEASE_NAME}" >/dev/null 2>&1; then
78
- echo "✅ (Github) Version mevcut: ${RELEASE_NAME}"
79
- else
80
- if [[ "${DRY_RUN}" == "false" ]]; then
81
- echo "⛔ (Github) Error: Bu version bulunamadı: ${RELEASE_NAME}"
82
- exit 1
83
- else
84
- echo "⚠️ (Github) Warning: Bu version bulunamadı: ${RELEASE_NAME} (dry-run modunda atlanıyor.)"
85
- fi
86
- fi
87
- fi
88
-
89
- RELEASE_EXTRA_FLAGS=""
90
-
91
- if [[ -z "${RELEASE_TITLE}" ]]; then
92
- RELEASE_EXTRA_FLAGS+="--title \"${RELEASE_NAME}\""
93
- else
94
- RELEASE_EXTRA_FLAGS+="--title \"${RELEASE_TITLE}\""
95
- fi
96
-
97
- if [[ "${RELEASE_NO_NOTES}" == "true" ]]; then
98
- RELEASE_EXTRA_FLAGS+=" --notes \"\""
99
- elif [[ -n "${RELEASE_NOTES_FILE}" ]]; then
100
- if [[ ! -f "${RELEASE_NOTES_FILE}" ]]; then
101
- echo "⛔ (Github) Error: Not dosyası bulunamadı: ${RELEASE_NOTES_FILE}"
102
- exit 1
103
- fi
104
- # Release notes dosyasını oku ve GitHub notes ile birleştir
105
- TEMP_COMBINED_NOTES="$(mktemp)"
106
- trap "rm -f '${TEMP_COMBINED_NOTES}'" EXIT
107
-
108
- # Dosyadan notları al
109
- cat "${RELEASE_NOTES_FILE}" > "${TEMP_COMBINED_NOTES}"
110
- echo "" >> "${TEMP_COMBINED_NOTES}"
111
- echo "---" >> "${TEMP_COMBINED_NOTES}"
112
- echo "" >> "${TEMP_COMBINED_NOTES}"
113
-
114
- # Auto-generated notes ekle
115
- echo "## What's Changed" >> "${TEMP_COMBINED_NOTES}"
116
- gh api "repos/{owner}/{repo}/releases/generate-notes" \
117
- -f tag_name="${CURRENT_VERSION_NUMBER}" \
118
- -f target_commitish="$(git rev-parse HEAD)" \
119
- --jq '.body' >> "${TEMP_COMBINED_NOTES}" 2>/dev/null || echo "Auto-generated release notes could not be created." >> "${TEMP_COMBINED_NOTES}"
120
-
121
- RELEASE_EXTRA_FLAGS+=" --notes-file \"${TEMP_COMBINED_NOTES}\""
122
- else
123
- RELEASE_EXTRA_FLAGS+=" --generate-notes"
124
- fi
125
-
126
- if [[ "${IS_NH_VERSION}" == "false" ]]; then
127
- run "gh release create \"${RELEASE_NAME}\" ${RELEASE_EXTRA_FLAGS}"
128
- fi
129
-
130
- echo "📦 (Github) Sürüm pakedi yükleniyor: ${LIBRARY_ZIP}"
131
- if [[ -f "${LIBRARY_ZIP}" ]]; then
132
- run "gh release upload \"${RELEASE_NAME}\" \"${LIBRARY_ZIP}\" --clobber"
133
- else
134
- echo "⚠️ (Github) Warning: Asset bulunamadı, atlanıyor: ${LIBRARY_ZIP}"
135
- fi
136
- echo "✅ (Github) Deployment tamamlandı: ${CURRENT_VERSION_NUMBER}"
package/devops/release.sh DELETED
@@ -1,101 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
-
4
- usage() {
5
- cat <<EOF
6
- Kullanım: $(basename "$0") [opsiyonlar]
7
-
8
- Opsiyonel:
9
- --npm NPM'e publish edilsin mi?
10
- --github Github release oluşturulsun mu?
11
- --dry-run Komutları yazdır, çalıştırma
12
- --notes-file Release notları dosyası
13
- --generate-native-notes Native SDK release notlarını oluştur
14
-
15
- Örnekler:
16
- $(basename "$0") --npm --github --dry-run
17
- $(basename "$0") --npm --github --generate-native-notes
18
- $(basename "$0") --npm --notes-file /path/to/CHANGELOG.md
19
- EOF
20
- }
21
-
22
- NPM_PUBLISH="false"
23
- GITHUB_RELEASE="false"
24
- DRY_RUN="false"
25
- RELEASE_NOTES_FILE=""
26
- GENERATE_NATIVE_NOTES="false"
27
-
28
- while [[ $# -gt 0 ]]; do
29
- case "$1" in
30
- --npm) NPM_PUBLISH="true"; shift;;
31
- --github) GITHUB_RELEASE="true"; shift;;
32
- --dry-run) DRY_RUN="true"; shift;;
33
- --notes-file) RELEASE_NOTES_FILE="$2"; shift 2;;
34
- --generate-native-notes) GENERATE_NATIVE_NOTES="true"; shift;;
35
- -h|--help) usage; exit 0;;
36
- *) echo "⛔ Error: Bilinmeyen argüman: $1"; usage; exit 1;;
37
- esac
38
- done
39
-
40
- # Dry run method
41
- run() {
42
- echo "+ $*"
43
- if [[ "${DRY_RUN}" == "false" ]]; then
44
- eval "$@"
45
- fi
46
- }
47
-
48
- PROJECT_ROOT="$(git rev-parse --show-toplevel 2>/dev/null || pwd)"
49
- PACKAGE_FILE_NAME="package.json"
50
- CURRENT_VERSION_NUMBER="$(sed -nE 's/^[[:space:]]*"version"[[:space:]]*:[[:space:]]*"([^"]+)".*/\1/p' "${PROJECT_ROOT}/${PACKAGE_FILE_NAME}" | head -n1)"
51
-
52
- echo "ℹ️ Güncel versiyon: ${CURRENT_VERSION_NUMBER}"
53
-
54
- # NH versiyonu kontrolü
55
- IS_NH="false"
56
- NPM_TAG=""
57
- if [[ "${CURRENT_VERSION_NUMBER}" == *-nh ]]; then
58
- IS_NH="true"
59
- NPM_TAG="--tag nh"
60
- echo "ℹ️ (-nh) versiyonu tespit edildi."
61
- fi
62
-
63
- NPM_PACKAGE_NAME="$(npm pack ${NPM_TAG} --quiet 2>&1)"
64
-
65
- # GitHub Release
66
- if [[ "${GITHUB_RELEASE}" == "true" ]]; then
67
- NOTES_FILE_ARG=""
68
- if [[ "${GENERATE_NATIVE_NOTES}" == "true" ]]; then
69
- TEMP_NOTES_FILE="$(mktemp)"
70
- trap "rm -f '${TEMP_NOTES_FILE}'" EXIT
71
-
72
- test -x "${PROJECT_ROOT}/devops/generate_native_release_notes.sh" || chmod +x "${PROJECT_ROOT}/devops/generate_native_release_notes.sh"
73
- bash "${PROJECT_ROOT}/devops/generate_native_release_notes.sh" > "${TEMP_NOTES_FILE}" || true
74
-
75
- NOTES_FILE_ARG="--notes-file ${TEMP_NOTES_FILE}"
76
- elif [[ -n "${RELEASE_NOTES_FILE}" ]]; then
77
- NOTES_FILE_ARG="--notes-file ${RELEASE_NOTES_FILE}"
78
- fi
79
- test -x "${PROJECT_ROOT}/devops/github_deploy_release.sh" || chmod +x "${PROJECT_ROOT}/devops/github_deploy_release.sh"
80
- GITHUB_ARGS="--package ${PROJECT_ROOT}/${NPM_PACKAGE_NAME}"
81
- if [[ "${DRY_RUN}" == "true" ]]; then
82
- GITHUB_ARGS="${GITHUB_ARGS} --dry-run"
83
- fi
84
- if [[ -n "${NOTES_FILE_ARG}" ]]; then
85
- GITHUB_ARGS="${GITHUB_ARGS} ${NOTES_FILE_ARG}"
86
- fi
87
- bash "${PROJECT_ROOT}/devops/github_deploy_release.sh" ${GITHUB_ARGS}
88
- fi
89
-
90
- # NPM Publish
91
- if [[ "${NPM_PUBLISH}" == "true" ]]; then
92
- echo "ℹ️ (npm) Paket yayınlanıyor: ${CURRENT_VERSION_NUMBER}"
93
- if [[ "${DRY_RUN}" == "true" ]]; then
94
- run "npm publish ${NPM_TAG} --dry-run"
95
- else
96
- run "npm publish ${NPM_TAG}"
97
- fi
98
- echo "✅ (npm) Paket yayınlandı: ${CURRENT_VERSION_NUMBER}"
99
- fi
100
-
101
- echo "✅ (Release) Release işlemi tamamlandı."
@@ -1,190 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
-
4
- usage() {
5
- cat <<EOF
6
- Kullanım: $(basename "$0") -v <version> [opsiyonlar]
7
-
8
- Zorunlu:
9
- -v, --version <semver> Örn: 4.0.2 (release branch adı olabilir)
10
-
11
- Opsiyonel:
12
- -c, --commit (değişiklikler commit edilsin mi?)
13
-
14
- Örnekler:
15
- $(basename "$0") -v 4.0.2
16
- $(basename "$0") --version 4.0.2 --commit
17
- EOF
18
- }
19
-
20
- NEW_VERSION_NUMBER=""
21
- COMMIT_CHANGES="false"
22
- CHANGED_FILES=()
23
-
24
- while [[ $# -gt 0 ]]; do
25
- case "$1" in
26
- -v|--version) NEW_VERSION_NUMBER="$2"; shift 2;;
27
- -c|--commit) COMMIT_CHANGES="true"; shift;;
28
- -h|--help) usage; exit 0;;
29
- *) echo "⛔ Error: Bilinmeyen argüman: $1"; usage; exit 1;;
30
- esac
31
- done
32
-
33
- if [[ -z "${NEW_VERSION_NUMBER}" ]]; then
34
- echo "⛔ Error: --version zorunludur."
35
- usage; exit 1
36
- fi
37
-
38
- PROJECT_ROOT="$(git rev-parse --show-toplevel 2>/dev/null || pwd)"
39
-
40
- PACKAGE_FILE_NAME="package.json"
41
- PACKAGE_LOCK_FILE_NAME="package-lock.json"
42
-
43
- PODSPEC_FILE_NAME="RNInsider.podspec"
44
- GRADLE_FILE_NAME="android/build.gradle"
45
-
46
- echo "ℹ️ Versiyon güncelleme başlatıldı: ${PROJECT_ROOT}"
47
- CURRENT_VERSION_NUMBER="$(sed -nE 's/^[[:space:]]*"version"[[:space:]]*:[[:space:]]*"([^"]+)".*/\1/p' "${PROJECT_ROOT}/${PACKAGE_FILE_NAME}" | head -n1)"
48
-
49
- echo "ℹ️ Güncel versiyon: ${CURRENT_VERSION_NUMBER}"
50
- SED_EXPRESSION="s/(\"version\"[[:space:]]*:[[:space:]]*\")[^\"]+(\")/\1${NEW_VERSION_NUMBER}\2/"
51
-
52
- if [[ "$OSTYPE" == darwin* ]]; then
53
- sed -i '' -E "${SED_EXPRESSION}" "${PROJECT_ROOT}/${PACKAGE_FILE_NAME}"
54
- else
55
- sed -i -E "${SED_EXPRESSION}" "${PROJECT_ROOT}/${PACKAGE_FILE_NAME}"
56
- fi
57
-
58
- PACKAGE_LOCK="$(jq --arg v "${NEW_VERSION_NUMBER}" \
59
- '.version=$v | if (.packages and .packages[""]) then .packages[""].version=$v else . end' \
60
- "${PROJECT_ROOT}/${PACKAGE_LOCK_FILE_NAME}")"
61
-
62
- echo "${PACKAGE_LOCK}" > "${PROJECT_ROOT}/${PACKAGE_LOCK_FILE_NAME}"
63
-
64
- read_iOS_SDK_version_from_podspec() {
65
- version=$(pod trunk info "${1}" 2>/dev/null \
66
- | sed -nE 's/^[[:space:]]*-[[:space:]]*([^[:space:]]+)[[:space:]]*\(([^)]+)\).*/\2|\1/p' \
67
- | awk -F'|' '$2 !~ /-/' \
68
- | sort -t'|' -k1,1r \
69
- | head -n1 \
70
- | cut -d'|' -f2
71
- )
72
- echo "${version}"
73
- }
74
-
75
- apply_iOS_SDK_version_in_podspec() {
76
- local podspec_path="${PROJECT_ROOT}/${PODSPEC_FILE_NAME}"
77
- local module=$1
78
- local new_version=$2
79
- local expression="s/^([[:space:]]*s\.dependency[[:space:]]*['\"]${module}['\"][[:space:]]*,[[:space:]]*)(['\"])([^'\"#]+)(['\"][[:space:]]*(#.*)?)$/\1\2${new_version}\4/"
80
- local source_expression="s|(s\.source[[:space:]]*=[[:space:]]*[^'\"]*['\"][^'\"]*/)[0-9]+\.[0-9]+\.[0-9]+(/[^'\"]*\.zip['\"])|\1${new_version}\2|"
81
- if [[ "$OSTYPE" == darwin* ]]; then
82
- sed -i '' -E "${expression}" "${podspec_path}"
83
- if [[ "${module}" == "InsiderMobile" ]]; then
84
- sed -i '' -E "${source_expression}" "${podspec_path}"
85
- fi
86
- else
87
- sed -i -E "${expression}" "${podspec_path}"
88
- if [[ "${module}" == "InsiderMobile" ]]; then
89
- sed -i -E "${source_expression}" "${podspec_path}"
90
- fi
91
- fi
92
- }
93
-
94
- read_android_SDK_version_from_maven() {
95
- local url="https://mobilesdk.useinsider.com/android/com/useinsider/${1}/maven-metadata.xml"
96
- local xml="$(curl -fsSL -H "Cache-Control: no-cache, no-store, must-revalidate" -H "Pragma: no-cache" "${url}")"
97
- local version="$(echo "${xml}" \
98
- | tr -d '\n' \
99
- | sed -nE 's/.*<release>[[:space:]]*([^<[:space:]]+)[[:space:]]*<\/release>.*/\1/p' \
100
- | head -1
101
- )"
102
-
103
- # NH version handling
104
- if [[ "${NEW_VERSION_NUMBER}" == *-nh ]]; then
105
- # RN version NH ise, Android SDK'da da -nh variant'ını tercih et
106
- if [[ "${version}" == *-nh ]]; then
107
- echo "${version}"
108
- else
109
- local version_nh="${version}-nh"
110
- if printf '%s' "${xml}" | grep -q "<version>${version_nh}</version>"; then
111
- echo "${version_nh}"
112
- else
113
- # NH variant yoksa normal versiyonu kullan
114
- echo "${version}"
115
- fi
116
- fi
117
- else
118
- # RN version NH değilse, normal versiyonu kullan (NH olmayan)
119
- if [[ "${version}" == *-nh ]]; then
120
- # Release version'ı NH değil, -nh olmayan en son versiyonu bul
121
- local non_nh_version="$(echo "${xml}" \
122
- | tr -d '\n' \
123
- | grep -oE '<version>[^<]+</version>' \
124
- | sed -E 's|</?version>||g' \
125
- | grep -v '\-nh$' \
126
- | sort -V \
127
- | tail -n1
128
- )"
129
- if [[ -n "${non_nh_version}" ]]; then
130
- echo "${non_nh_version}"
131
- else
132
- echo "${version}"
133
- fi
134
- else
135
- echo "${version}"
136
- fi
137
- fi
138
- }
139
-
140
- apply_android_SDK_version_in_maven() {
141
- local gradle_path="${PROJECT_ROOT}/${GRADLE_FILE_NAME}"
142
- local module=$1
143
- local new_version=$2
144
- local expression="s/^([[:space:]]*(implementation|api|compileOnly|runtimeOnly)[[:space:]]+['\"]com\.useinsider:${module}:)[^'\" ]+(['\"])/\1${new_version}\3/"
145
- if [[ "$OSTYPE" == darwin* ]]; then
146
- sed -i '' -E "${expression}" "${gradle_path}"
147
- else
148
- sed -i -E "${expression}" "${gradle_path}"
149
- fi
150
- }
151
-
152
- IOS_FRAMEWORKS=("InsiderMobile" "InsiderGeofence" "InsiderHybrid")
153
- for IOS_FRAMEWORK in "${IOS_FRAMEWORKS[@]}"; do
154
- IOS_CURRENT_VERSION_NUMBER=$(read_iOS_SDK_version_from_podspec "${IOS_FRAMEWORK}")
155
- apply_iOS_SDK_version_in_podspec "${IOS_FRAMEWORK}" "${IOS_CURRENT_VERSION_NUMBER}"
156
- echo "✅ iOS (${IOS_FRAMEWORK}) versiyonu güncellendi: ${IOS_CURRENT_VERSION_NUMBER}"
157
- done
158
-
159
- ANDROID_LIBRARIES=("insider" "insiderhybrid")
160
- for ANDROID_LIBRARY in "${ANDROID_LIBRARIES[@]}"; do
161
- ANDROID_CURRENT_VERSION_NUMBER=$(read_android_SDK_version_from_maven "${ANDROID_LIBRARY}")
162
- apply_android_SDK_version_in_maven "${ANDROID_LIBRARY}" "${ANDROID_CURRENT_VERSION_NUMBER}"
163
- echo "✅ Android (${ANDROID_LIBRARY}) versiyonu güncellendi: ${ANDROID_CURRENT_VERSION_NUMBER}"
164
- done
165
-
166
- echo "✅ Yeni versiyona güncellendi: ${NEW_VERSION_NUMBER}"
167
-
168
- CHANGED_FILES+=("${PROJECT_ROOT}/${PACKAGE_FILE_NAME}")
169
- CHANGED_FILES+=("${PROJECT_ROOT}/${GRADLE_FILE_NAME}")
170
- CHANGED_FILES+=("${PROJECT_ROOT}/${PODSPEC_FILE_NAME}")
171
- CHANGED_FILES+=("${PROJECT_ROOT}/${PACKAGE_LOCK_FILE_NAME}")
172
-
173
- if [[ "${COMMIT_CHANGES}" == "true" ]]; then
174
- if git rev-parse --git-dir > /dev/null 2>&1; then
175
- echo "ℹ️ Git commit hazırlanıyor..."
176
- if [ ${#CHANGED_FILES[@]} -gt 0 ]; then
177
- git add "${CHANGED_FILES[@]}"
178
- if git diff --cached --quiet; then
179
- echo "ℹ️ Commitlenecek değişiklik bulunamadı, işlem atlanıyor."
180
- else
181
- git commit -m "release: update version to ${NEW_VERSION_NUMBER}"
182
- echo "✅ Git commit oluşturuldu."
183
- fi
184
- else
185
- echo "ℹ️ Commitlenecek dosya bulunamadı, işlem atlanıyor."
186
- fi
187
- else
188
- echo "⛔ Error: Git repo değil, commit atlanıyor."
189
- fi
190
- fi
Binary file
Binary file
Binary file
Binary file
Binary file