forked from ValueCell-ai/valuecell
-
Notifications
You must be signed in to change notification settings - Fork 0
109 lines (90 loc) · 3.74 KB
/
win_build.yml
File metadata and controls
109 lines (90 loc) · 3.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
name: Tauri build on Windows
on:
push:
tags:
- "v*"
workflow_dispatch:
permissions:
contents: write
jobs:
build-windows:
strategy:
matrix:
include:
- args: ""
target: 'x86_64-pc-windows-msvc'
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Add UV Package Manager To Tauri Project
shell: pwsh
run: |
cd frontend/src-tauri
New-Item -ItemType Directory -Force -Path binaries | Out-Null
$ARCH = $env:PROCESSOR_ARCHITECTURE
Write-Host "Current runner architecture: $ARCH"
Write-Host "Matrix target: ${{ matrix.args }}"
# Download Windows version of uv
$UV_VERSION = "0.9.9"
$UV_ARCH = "x86_64-pc-windows-msvc"
Write-Host "Downloading uv for ${UV_ARCH}..."
$UV_URL = "https://github.com/astral-sh/uv/releases/download/${UV_VERSION}/uv-${UV_ARCH}.zip"
$UV_ZIP = "uv-${UV_ARCH}.zip"
$TEMP_DIR = "temp_${UV_ARCH}"
Invoke-WebRequest -Uri $UV_URL -OutFile $UV_ZIP
# Extract zip file
New-Item -ItemType Directory -Force -Path ${TEMP_DIR} | Out-Null
Expand-Archive -Path $UV_ZIP -DestinationPath ${TEMP_DIR} -Force
# Find uv.exe after extraction
$UV_PATH = Get-ChildItem -Path ${TEMP_DIR} -Filter "uv.exe" -Recurse | Select-Object -First 1
if (-not $UV_PATH) {
Write-Host "Error: uv.exe not found for ${UV_ARCH} after extraction"
Write-Host "Contents of ${TEMP_DIR}:"
Get-ChildItem -Path ${TEMP_DIR} -Recurse
exit 1
}
Write-Host "Found uv at: $($UV_PATH.FullName)"
# Move uv.exe to binaries directory
Copy-Item $UV_PATH.FullName "binaries/uv-${UV_ARCH}.exe"
# Clean up
Remove-Item -Recurse -Force ${TEMP_DIR}
Remove-Item -Force $UV_ZIP
# Debug: List all files in binaries directory
Write-Host "Contents of binaries directory:"
Get-ChildItem -Path binaries -Recurse
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version-file: "./frontend/package.json"
- name: Rust cache
uses: swatinem/rust-cache@v2
with:
workspaces: './src-tauri -> target'
- name: Install Dependencies
run: |
cd frontend
bun install
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD}}
with:
tagName: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && 'v__VERSION__' || '' }}
releaseName: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && 'ValueCell-__VERSION__-beta' || '' }}
releaseDraft: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}
prerelease: false
assetNamePattern: ValueCell-[version]-beta-[platform]-[arch][ext]
args: ${{ matrix.args }}
- name: Upload Artifacts
uses: actions/upload-artifact@v5
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
with:
path: |
frontend/src-tauri/target/release/bundle/msi/*.msi
frontend/src-tauri/target/release/bundle/nsis/*.exe
name: ValueCell-${{ matrix.target }}-${{ github.sha }}
retention-days: 3