Skip to content

Commit b427ddc

Browse files
authored
Update build-windows.yml
1 parent 698a534 commit b427ddc

1 file changed

Lines changed: 49 additions & 43 deletions

File tree

.github/workflows/build-windows.yml

Lines changed: 49 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -2,50 +2,56 @@ name: Build Windows Release
22

33
on:
44
push:
5-
branches: [ "main" ]
6-
workflow_dispatch:
7-
8-
env:
9-
CARGO_TERM_COLOR: always
5+
branches: [ main, master ] # Trigger kalau push ke main/master
6+
workflow_dispatch: # Bisa trigger manual dari GitHub UI
107

118
jobs:
12-
build:
13-
name: Build for Windows
9+
build-windows:
1410
runs-on: windows-latest
15-
11+
1612
steps:
17-
- uses: actions/checkout@v4
18-
19-
- name: Install Rust
20-
uses: dtolnay/rust-toolchain@stable
21-
with:
22-
toolchain: stable
23-
target: x86_64-pc-windows-msvc
24-
25-
- name: Build RAG API Server
26-
run: |
27-
cd sfcore-ai/crates/rag-api-server
28-
cargo build --release --target x86_64-pc-windows-msvc
29-
30-
- name: Prepare Artifacts
31-
shell: powershell
32-
run: |
33-
mkdir release
34-
copy sfcore-ai/target/x86_64-pc-windows-msvc/release/rag-api-server.exe release/
35-
copy sfcore-ai/crates/rag-api-server/config/settings.toml release/settings.toml.example
36-
copy sfcore-ai/crates/rag-api-server/.env.example release/.env.example
37-
38-
- name: Upload Artifact
39-
uses: actions/upload-artifact@v4
40-
with:
41-
name: rag-api-server-windows
42-
path: release/
43-
44-
- name: Release to GitHub
45-
uses: softprops/action-gh-release@v1
46-
if: github.ref == 'refs/heads/main'
47-
with:
48-
tag_name: latest
49-
files: sfcore-ai/target/x86_64-pc-windows-msvc/release/rag-api-server.exe
50-
token: ${{ secrets.GITHUB_TOKEN }}
51-
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
16+
- name: Setup Rust toolchain
17+
uses: dtolnay/rust-toolchain@stable
18+
with:
19+
targets: x86_64-pc-windows-msvc
20+
21+
- name: Cache cargo registry
22+
uses: actions/cache@v4
23+
with:
24+
path: |
25+
~/.cargo/registry
26+
~/.cargo/git
27+
target
28+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
29+
restore-keys: |
30+
${{ runner.os }}-cargo-
31+
32+
- name: Build release binary
33+
run: cargo build --release -p sfcore-ai-server
34+
env:
35+
RUST_BACKTRACE: 1
36+
37+
- name: Create release package
38+
run: |
39+
mkdir release-package
40+
copy target\release\sfcore-ai-server.exe release-package\
41+
copy crates\server\server_config.toml release-package\
42+
echo "SFCore AI Server - Windows x64" > release-package\README.txt
43+
echo "Build date: $(Get-Date -Format 'yyyy-MM-dd HH:mm:ss')" >> release-package\README.txt
44+
shell: pwsh
45+
46+
- name: Upload artifact
47+
uses: actions/upload-artifact@v4
48+
with:
49+
name: sfcore-ai-server-windows-x64
50+
path: release-package/
51+
retention-days: 30
52+
53+
- name: Display build info
54+
run: |
55+
echo "✅ Build complete!"
56+
echo "📦 Artifact: sfcore-ai-server-windows-x64"
57+
echo "📥 Download from: Actions > This workflow run > Artifacts"

0 commit comments

Comments
 (0)