Skip to content

Commit 8873d50

Browse files
authored
Merge pull request #430 from maximka76667/production
feat: replatform electron-app to work with testing-view
2 parents 264c6d0 + 0303b00 commit 8873d50

96 files changed

Lines changed: 3275 additions & 2662 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/dependabot.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,19 @@ updates:
33
- package-ecosystem: "npm"
44
directory: "/"
55
schedule:
6-
interval: "daily"
7-
target-branch: "develop"
6+
interval: "weekly"
7+
target-branch: "develop"
8+
# Ignore all patch updates (e.g. 1.0.1 -> 1.0.2)
9+
ignore:
10+
- dependency-name: "*"
11+
update-types: ["version-update:semver-patch"]
12+
813
- package-ecosystem: "npm"
914
directory: "/"
1015
schedule:
11-
interval: "daily"
12-
target-branch: "main"
16+
interval: "weekly"
17+
target-branch: "main"
18+
# Ignore all patch updates (e.g. 1.0.1 -> 1.0.2)
19+
ignore:
20+
- dependency-name: "*"
21+
update-types: ["version-update:semver-patch"]

.github/workflows/build.yaml

Lines changed: 135 additions & 425 deletions
Large diffs are not rendered by default.

.github/workflows/release.yaml

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -67,17 +67,22 @@ jobs:
6767
- name: Checkout repository
6868
uses: actions/checkout@v4
6969

70+
- uses: pnpm/action-setup@v4
71+
with:
72+
version: 10.26.0
73+
7074
- name: Setup Node.js
7175
uses: actions/setup-node@v4
7276
with:
7377
node-version: "20"
78+
cache: "pnpm"
7479

7580
# Update package.json with release version
7681
- name: Update version in package.json
7782
working-directory: electron-app
7883
shell: bash
7984
run: |
80-
npm version ${{ needs.determine-version.outputs.version }} --no-git-tag-version
85+
pnpm version ${{ needs.determine-version.outputs.version }} --no-git-tag-version
8186
echo "Updated version to:"
8287
cat package.json | grep version
8388
@@ -123,35 +128,36 @@ jobs:
123128
path: electron-app/binaries
124129

125130
# Download frontend builds from latest build
126-
- name: Download control-station
127-
uses: dawidd6/action-download-artifact@v3
128-
with:
129-
workflow: build.yaml
130-
branch: production
131-
workflow_conclusion: success
132-
name: control-station
133-
path: electron-app/renderer/control-station
134-
135-
- name: Download ethernet-view
131+
# TODO: Uncomment when competition view is ready
132+
# - name: Download competition-view
133+
# uses: dawidd6/action-download-artifact@v3
134+
# with:
135+
# workflow: build.yaml
136+
# branch: production
137+
# workflow_conclusion: success
138+
# name: competition-view
139+
# path: electron-app/renderer/competition-view
140+
141+
- name: Download testing-view
136142
uses: dawidd6/action-download-artifact@v3
137143
with:
138144
workflow: build.yaml
139145
branch: production
140146
workflow_conclusion: success
141-
name: ethernet-view
142-
path: electron-app/renderer/ethernet-view
147+
name: testing-view
148+
path: electron-app/renderer/testing-view
143149

144150
- name: Set executable permissions (Unix)
145151
if: runner.os != 'Windows'
146152
run: chmod +x electron-app/binaries/*
147153

148154
- name: Install Electron dependencies
149155
working-directory: electron-app
150-
run: npm ci
156+
run: pnpm install
151157

152158
- name: Build Electron distribution
153159
working-directory: electron-app
154-
run: npm run dist
160+
run: pnpm run dist
155161
env:
156162
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
157163
CSC_IDENTITY_AUTO_DISCOVERY: false
@@ -178,6 +184,8 @@ jobs:
178184
electron-app/dist/*.deb
179185
electron-app/dist/*.dmg
180186
electron-app/dist/*.zip
187+
electron-app/dist/*.yml
188+
electron-app/dist/*.blockmap
181189
!electron-app/dist/*-unpacked
182190
!electron-app/dist/mac
183191
!electron-app/dist/win-unpacked

backend/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"dev": "go run ./cmd --config ./cmd/dev-config.toml",
99
"dev:main": "go run ./cmd --config ./cmd/config.toml",
1010
"build": "go build -o bin/backend ./cmd",
11+
"build:ci": "go build",
1112
"test": "go test ./..."
1213
}
1314
}

electron-app/BUILD.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# Hyperloop Control Station Build System
2+
3+
The project uses a unified, modular build script (`electron-app/build.mjs`) to handle building the backend (Go), packet sender (Rust), and frontends (React/Vite) for the Electron application.
4+
5+
## Prerequisites
6+
7+
- **Node.js** & **pnpm**
8+
- **Go** (1.21+)
9+
- **Rust/Cargo** (for Packet Sender)
10+
11+
## Basic Usage
12+
13+
Run the build script from the `electron-app` directory (or via npm scripts).
14+
15+
```sh
16+
# Build EVERYTHING (Backend, Packet Sender, Frontends)
17+
pnpm build
18+
19+
# OR
20+
node build.mjs
21+
```
22+
23+
## Configuration
24+
25+
The build configuration is defined in `electron-app/build.mjs` within the `CONFIG` object.
26+
27+
## Build Specific Components
28+
29+
You can build individual components by passing their flag.
30+
31+
```sh
32+
# Build only the Backend
33+
node build.mjs --backend
34+
35+
# Build only the Testing View
36+
node build.mjs --testing-view
37+
38+
# Build only the Packet Sender
39+
node build.mjs --packet-sender
40+
```
41+
42+
## Platform Targeting
43+
44+
By default, the script builds for all defined platforms (Windows, Linux, macOS). You can limit this using flags.
45+
46+
```sh
47+
# Build backend for Windows only
48+
node build.mjs --backend --win
49+
50+
# Build everything for Linux
51+
node build.mjs --linux
52+
```
53+
54+
## Advanced: Overwriting Commands
55+
56+
The build script allows you to override configuration properties on the fly. This is useful for CI pipelines where you might want to use different build commands or flags.
57+
58+
**Syntax**: `--[target].[property]="value"`
59+
60+
### Examples
61+
62+
```sh
63+
# Use a custom build command for the backend:
64+
node build.mjs --backend --backend.commands="pnpm run build:prod --"
65+
66+
# Change the output directory
67+
node build.mjs --backend --backend.output="./dist/bin"
68+
69+
# Pass arguments to the underlying tools (passes -v)
70+
node build.mjs --backend -- -v
71+
```

electron-app/app-update.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
provider: github
2+
owner: Hyperloop-UPV
3+
repo: software
4+
updaterCacheDirName: hyperloop-control-station/updater

0 commit comments

Comments
 (0)