Skip to content

Commit b42c797

Browse files
committed
ci: migrate release workflow to uv and call build.sh
1 parent 9a0ff83 commit b42c797

2 files changed

Lines changed: 33 additions & 28 deletions

File tree

.github/workflows/release.yml

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,21 @@ jobs:
1111

1212
steps:
1313
- name: Checkout code
14-
uses: actions/checkout@v3
14+
uses: actions/checkout@v4
1515

16-
- name: Set up Python
17-
uses: actions/setup-python@v4
16+
- name: Install uv
17+
uses: astral-sh/setup-uv@v4
1818
with:
19-
python-version: '3.12'
19+
enable-cache: true
2020

21-
- name: Install dependencies
22-
run: |
23-
pip install -r requirements.txt
24-
pip install pyinstaller
21+
- name: Sync dependencies
22+
run: uv sync --group dev
2523

2624
- name: Build Linux binary
27-
run: |
28-
pyinstaller --onefile --name git-commit-gen --add-data "prompt_template.yml:." main.py
29-
mv dist/git-commit-gen ./git-commit-gen-linux
25+
run: ./build.sh
26+
27+
- name: Rename binary for release
28+
run: mv git-commit-gen git-commit-gen-linux
3029

3130
- name: Upload Linux binary
3231
uses: softprops/action-gh-release@v2
@@ -40,23 +39,24 @@ jobs:
4039

4140
steps:
4241
- name: Checkout code
43-
uses: actions/checkout@v3
42+
uses: actions/checkout@v4
4443

45-
- name: Set up Python
46-
uses: actions/setup-python@v4
44+
- name: Install uv
45+
uses: astral-sh/setup-uv@v4
4746
with:
48-
python-version: '3.12'
47+
enable-cache: true
4948

50-
- name: Install dependencies
51-
run: |
52-
pip install -r requirements.txt
53-
pip install pyinstaller
49+
- name: Sync dependencies
50+
run: uv sync --group dev
51+
shell: bash
5452

5553
- name: Build Windows binary
56-
run: |
57-
pyinstaller --onefile --name git-commit-gen.exe --add-data "prompt_template.yml;." main.py
58-
Move-Item -Path dist\git-commit-gen.exe -Destination git-commit-gen-win.exe
59-
shell: pwsh
54+
run: ./build.sh
55+
shell: bash
56+
57+
- name: Rename binary for release
58+
run: mv git-commit-gen.exe git-commit-gen-win.exe
59+
shell: bash
6060

6161
- name: Upload Windows binary
6262
uses: softprops/action-gh-release@v2

build.sh

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ while [[ $# -gt 0 ]]; do
3232
esac
3333
done
3434

35+
case "$(uname -s)" in
36+
CYGWIN*|MINGW*|MSYS*) SEP=";" ;;
37+
*) SEP=":" ;;
38+
esac
39+
3540
echo "🛠️ 빌드 설정: model=${DEFAULT_MODEL}, language=${DEFAULT_LANGUAGE}, auto_yes=${AUTO_YES}"
3641

3742
cat > build_defaults.json <<EOF
@@ -50,14 +55,14 @@ trap cleanup EXIT
5055
echo "🚧 Building executable with uv..."
5156
uv run --group dev pyinstaller --onefile \
5257
--name "$EXE_NAME" \
53-
--add-data "prompt_template.yml:." \
54-
--add-data "build_defaults.json:." \
58+
--add-data "prompt_template.yml${SEP}." \
59+
--add-data "build_defaults.json${SEP}." \
5560
main.py
5661

5762
echo "📦 Moving executable to current directory..."
58-
mv -f "dist/$EXE_NAME" ./
63+
mv -f "dist/$EXE_NAME"* ./
5964

6065
echo "🧹 Cleaning up..."
61-
rm -rf build dist "$EXE_NAME".spec
66+
rm -rf build dist "$EXE_NAME"*.spec
6267

63-
echo "✅ Done! Executable: $EXE_NAME (model=${DEFAULT_MODEL}, language=${DEFAULT_LANGUAGE}, auto_yes=${AUTO_YES})"
68+
echo "✅ Done! (model=${DEFAULT_MODEL}, language=${DEFAULT_LANGUAGE}, auto_yes=${AUTO_YES})"

0 commit comments

Comments
 (0)