forked from eigent-ai/eigent
-
Notifications
You must be signed in to change notification settings - Fork 0
148 lines (128 loc) · 4.74 KB
/
build-view.yml
File metadata and controls
148 lines (128 loc) · 4.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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
name: Build-View
on:
workflow_dispatch:
permissions:
contents: write
jobs:
build:
runs-on: ${{ matrix.os }}
timeout-minutes: 120
strategy:
matrix:
include:
- os: macos-latest
arch: arm64
- os: macos-15-intel
arch: x64
- os: windows-latest
arch: x64
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 20
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: '3.11'
- name: Install Python Dependencies
run: |
python -m pip install --upgrade pip
pip install uv
- name: Install bun
run: npm install -g bun
- name: Install Dependencies
run: npm install
# Step for macOS builds with signing
- name: Build Release Files (macOS with signing)
if: runner.os == 'macOS'
timeout-minutes: 90
run: npm run build -- --arch ${{ matrix.arch }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CSC_LINK: ${{ secrets.CERT_P12 }}
CSC_KEY_PASSWORD: ${{ secrets.CERT_PASSWORD }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
VITE_BASE_URL: ${{ secrets.VITE_BASE_URL }}
VITE_STACK_PROJECT_ID: ${{ secrets.VITE_STACK_PROJECT_ID }}
VITE_STACK_PUBLISHABLE_CLIENT_KEY: ${{ secrets.VITE_STACK_PUBLISHABLE_CLIENT_KEY }}
VITE_STACK_SECRET_SERVER_KEY: ${{ secrets.VITE_STACK_SECRET_SERVER_KEY }}
USE_NPM_INSTALL_BUN: 'true'
# Step for Windows builds without signing
- name: Build Release Files (Windows without signing)
if: runner.os == 'Windows'
timeout-minutes: 90
run: npm run build -- --arch ${{ matrix.arch }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Signing variables (CSC_LINK, CSC_KEY_PASSWORD) are omitted for Windows
VITE_BASE_URL: ${{ secrets.VITE_BASE_URL }}
VITE_STACK_PROJECT_ID: ${{ secrets.VITE_STACK_PROJECT_ID }}
VITE_STACK_PUBLISHABLE_CLIENT_KEY: ${{ secrets.VITE_STACK_PUBLISHABLE_CLIENT_KEY }}
VITE_STACK_SECRET_SERVER_KEY: ${{ secrets.VITE_STACK_SECRET_SERVER_KEY }}
USE_NPM_INSTALL_BUN: 'true'
- name: Upload Artifact (macOS - dmg only)
if: runner.os == 'macOS'
uses: actions/upload-artifact@v6
with:
name: release-${{ matrix.os }}-${{ matrix.arch }}
path: |
release/*.dmg
retention-days: 5
- name: Upload Artifact (Windows - exe only)
if: runner.os == 'Windows'
uses: actions/upload-artifact@v6
with:
name: release-${{ matrix.os }}-${{ matrix.arch }}
path: |
release/*.exe
retention-days: 5
merge-release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Create directories
run: |
mkdir -p release/mac-x64 release/mac-arm64 release/win-x64
# Download all artifacts with correct names
- name: Download mac-x64 artifact
uses: actions/download-artifact@v7
with:
name: release-macos-15-intel-x64
path: temp-mac-x64
- name: Download mac-arm64 artifact
uses: actions/download-artifact@v7
with:
name: release-macos-latest-arm64
path: temp-mac-arm64
- name: Download win-x64 artifact
uses: actions/download-artifact@v7
with:
name: release-windows-latest-x64
path: temp-win-x64
# Move only dmg files for macOS and exe files for Windows
- name: Move files to clean folders
shell: bash
run: |
# mac-x64 - only move dmg files
if [ -d "temp-mac-x64/release" ]; then
find temp-mac-x64/release -name "*.dmg" -exec mv {} release/mac-x64/ \; || true
else
find temp-mac-x64 -name "*.dmg" -exec mv {} release/mac-x64/ \; || true
fi
# mac-arm64 - only move dmg files
if [ -d "temp-mac-arm64/release" ]; then
find temp-mac-arm64/release -name "*.dmg" -exec mv {} release/mac-arm64/ \; || true
else
find temp-mac-arm64 -name "*.dmg" -exec mv {} release/mac-arm64/ \; || true
fi
# win-x64 - only move exe files
if [ -d "temp-win-x64/release" ]; then
find temp-win-x64/release -name "*.exe" -exec mv {} release/win-x64/ \; || true
else
find temp-win-x64 -name "*.exe" -exec mv {} release/win-x64/ \; || true
fi