Skip to content

Commit f28154c

Browse files
authored
Test build (#362)
2 parents eeae066 + 95e09cf commit f28154c

File tree

1 file changed

+138
-0
lines changed

1 file changed

+138
-0
lines changed

.github/workflows/build-view.yml

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
name: Build-View
2+
3+
on:
4+
workflow_dispatch:
5+
6+
permissions:
7+
contents: write
8+
9+
jobs:
10+
build:
11+
runs-on: ${{ matrix.os }}
12+
13+
strategy:
14+
matrix:
15+
include:
16+
- os: macos-latest
17+
arch: arm64
18+
- os: macos-13
19+
arch: x64
20+
- os: windows-latest
21+
arch: x64
22+
23+
steps:
24+
- name: Checkout Code
25+
uses: actions/checkout@v4
26+
27+
- name: Setup Node.js
28+
uses: actions/setup-node@v4
29+
with:
30+
node-version: 20
31+
32+
- name: Setup Python
33+
uses: actions/setup-python@v4
34+
with:
35+
python-version: "3.11"
36+
37+
- name: Install Python Dependencies
38+
run: |
39+
python -m pip install --upgrade pip
40+
pip install uv
41+
42+
- name: Install Dependencies
43+
run: npm install
44+
45+
# Step for macOS builds with signing
46+
- name: Build Release Files (macOS with signing)
47+
if: runner.os == 'macOS'
48+
run: npm run build -- --arch ${{ matrix.arch }}
49+
env:
50+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
51+
CSC_LINK: ${{ secrets.CERT_P12 }}
52+
CSC_KEY_PASSWORD: ${{ secrets.CERT_PASSWORD }}
53+
APPLE_ID: ${{ secrets.APPLE_ID }}
54+
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }}
55+
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
56+
VITE_BASE_URL: ${{ secrets.VITE_BASE_URL }}
57+
VITE_STACK_PROJECT_ID: ${{ secrets.VITE_STACK_PROJECT_ID }}
58+
VITE_STACK_PUBLISHABLE_CLIENT_KEY: ${{ secrets.VITE_STACK_PUBLISHABLE_CLIENT_KEY }}
59+
VITE_STACK_SECRET_SERVER_KEY: ${{ secrets.VITE_STACK_SECRET_SERVER_KEY }}
60+
61+
# Step for Windows builds without signing
62+
- name: Build Release Files (Windows without signing)
63+
if: runner.os == 'Windows'
64+
run: npm run build -- --arch ${{ matrix.arch }}
65+
env:
66+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
67+
# Signing variables (CSC_LINK, CSC_KEY_PASSWORD) are omitted for Windows
68+
VITE_BASE_URL: ${{ secrets.VITE_BASE_URL }}
69+
VITE_STACK_PROJECT_ID: ${{ secrets.VITE_STACK_PROJECT_ID }}
70+
VITE_STACK_PUBLISHABLE_CLIENT_KEY: ${{ secrets.VITE_STACK_PUBLISHABLE_CLIENT_KEY }}
71+
VITE_STACK_SECRET_SERVER_KEY: ${{ secrets.VITE_STACK_SECRET_SERVER_KEY }}
72+
73+
- name: Upload Artifact
74+
uses: actions/upload-artifact@v4
75+
with:
76+
name: release-${{ matrix.os }}-${{ matrix.arch }}
77+
path: |
78+
release/*
79+
!release/builder-debug.yml
80+
!release/builder-effective-config.yaml
81+
retention-days: 5
82+
merge-release:
83+
needs: build
84+
runs-on: ubuntu-latest
85+
steps:
86+
- name: Create directories
87+
run: |
88+
mkdir -p release/mac-x64 release/mac-arm64 release/win-x64
89+
90+
# Download all artifacts with correct names
91+
- name: Download mac-x64 artifact
92+
uses: actions/download-artifact@v4
93+
with:
94+
name: release-macos-13-x64
95+
path: temp-mac-x64
96+
97+
- name: Download mac-arm64 artifact
98+
uses: actions/download-artifact@v4
99+
with:
100+
name: release-macos-latest-arm64
101+
path: temp-mac-arm64
102+
103+
- name: Download win-x64 artifact
104+
uses: actions/download-artifact@v4
105+
with:
106+
name: release-windows-latest-x64
107+
path: temp-win-x64
108+
109+
# Move files to final release directory, removing any nested release/ directory
110+
- name: Move files to clean folders
111+
shell: bash
112+
run: |
113+
# mac-x64
114+
if [ -d "temp-mac-x64/release" ]; then
115+
mv temp-mac-x64/release/* release/mac-x64/ || true
116+
else
117+
mv temp-mac-x64/* release/mac-x64/ || true
118+
fi
119+
120+
# mac-arm64
121+
if [ -d "temp-mac-arm64/release" ]; then
122+
mv temp-mac-arm64/release/* release/mac-arm64/ || true
123+
else
124+
mv temp-mac-arm64/* release/mac-arm64/ || true
125+
fi
126+
127+
# win-x64
128+
if [ -d "temp-win-x64/release" ]; then
129+
mv temp-win-x64/release/* release/win-x64/ || true
130+
else
131+
mv temp-win-x64/* release/win-x64/ || true
132+
fi
133+
134+
- name: Rename duplicate files
135+
run: |
136+
mv release/mac-x64/latest-mac.yml release/mac-x64/latest-x64-mac.yml || true
137+
mv release/mac-arm64/latest-mac.yml release/mac-arm64/latest-arm64-mac.yml || true
138+

0 commit comments

Comments
 (0)