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
2 changes: 1 addition & 1 deletion .github/hooks/pre-commit
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh
set -e
set -euo pipefail

# 1) staged 파일 중 JS/TS 계열만 판별
all_files=$(git diff --cached --name-only --diff-filter=ACM)
Expand Down
2 changes: 1 addition & 1 deletion .github/hooks/pre-push
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
set -e
set -euo pipefail

# 푸시를 실행한 원격 이름과 URL
remote_name=$1
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/pr-title-lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: PR Title Lint

on:
pull_request:
types: [opened, edited, synchronize, reopened]

jobs:
title-lint:
runs-on: ubuntu-latest
permissions:
pull-requests: read
steps:
- uses: actions/checkout@v3
- name: Lint PR title
uses: deepakputhraya/action-pr-title@v1.0.2
with:
regex: '^\[(Feature|Fix|Chore|Docs|Style|Refactor|Test)\]!? .+(?: \(#\d+\))?$'
prefix_case_sensitive: true
github_token: ${{ github.token }}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"dev": "bash src/scripts/start-dev.sh",
"build": "bash src/scripts/build.sh",
"android": "react-native run-android",
"android:build": "bash android/gradlew assembleDebug",
"android:build": "cd android && bash gradlew assembleDebug",
"windows": "npx react-native run-windows",
"windows:build": "react-native run-windows --no-launch --no-deploy --no-packager",
"windows:init": "react-native init-windows --overwrite && npx react-native run-windows --msbuildprops \"RestoreLockedMode=false;BinaryLogger=;UseSharedCompilation=false;MaximumCpuCount=1\"",
Expand Down
39 changes: 26 additions & 13 deletions src/scripts/build.sh
Original file line number Diff line number Diff line change
@@ -1,22 +1,35 @@
#!/bin/sh
set -e

This comment was marked as resolved.

Copy link
Collaborator Author

@dioo1461 dioo1461 Apr 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I know, pipefail is a bash-only construct. Am I right?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you're correct. set -o pipefail is a bash-specific feature and won't work with /bin/sh. For sh compatibility, we should stick with just set -eu. Alternatively, if pipefail is needed, we could change the shebang to #!/bin/bash.


## OS 확인
if [[ "$OSTYPE" == "darwin"* ]]; then
echo "Detected OS: macOS"
npm run macos:build &
npm run ios:build &
wait
case "$OSTYPE" in
darwin*)
echo "Detected OS: macOS"
npm run macos:build & pid1=$!
npm run ios:build & pid2=$!
;;
cygwin*|msys*|win32*)
echo "Detected OS: Windows"
npm run windows:build & pid1=$!
npm run android:build & pid2=$!
;;
*)
echo "Unknown OS: $OSTYPE" >&2
exit 1
;;
esac

elif [[ "$OSTYPE" == "cygwin" ]] || [[ "$OSTYPE" == "msys" ]] || [[ "$OSTYPE" == "win32" ]]; then
echo "Detected OS: Windows"
npm run windows:build &
npm run android:build &
wait
# 백그라운드 작업 완료 대기 후 exit code 수집
wait "$pid1"
ec1=$?
wait "$pid2"
ec2=$?

else
echo "Unknown OS: $OSTYPE"
# 둘 중 하나라도 실패하면 exit 1
if [ "$ec1" -ne 0 ] || [ "$ec2" -ne 0 ]; then
echo "❌ 빌드 중 에러가 발생하였습니다. (desktop app: $ec1, mobile app: $ec2)" >&2
exit 1
fi

echo "모든 빌드가 완료되었습니다."
echo "모든 빌드가 성공적으로 완료되었습니다."
exit 0
2 changes: 1 addition & 1 deletion src/scripts/generate-cert.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ elif [[ "$OSTYPE" == "cygwin" ]] || [[ "$OSTYPE" == "msys" ]] || [[ "$OSTYPE" ==
curl -L -o mkcert.exe https://github.com/FiloSottile/mkcert/releases/latest/download/mkcert-v1.4.4-windows-amd64.exe

else
echo "Unknown OS: $OSTYPE"
echo "Unknown OS: $OSTYPE" >&2
exit 1
fi

Expand Down
2 changes: 1 addition & 1 deletion src/scripts/start-dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ elif [[ "$OSTYPE" == "cygwin" ]] || [[ "$OSTYPE" == "msys" ]] || [[ "$OSTYPE" ==
wait

else
echo "Unknown OS: $OSTYPE"
echo "Unknown OS: $OSTYPE" >&2
exit 1
fi

Expand Down