Skip to content

Commit 4365a63

Browse files
committed
Merge branch 'develop' into feature/proper-mdns-support
2 parents dae41bb + 95fa239 commit 4365a63

File tree

309 files changed

+11543
-9259
lines changed

Some content is hidden

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

309 files changed

+11543
-9259
lines changed

.changeset/mighty-pets-report.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'frontend': patch
3+
---
4+
5+
Improve authtoken handling in 401 responses
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'firmware': patch
3+
---
4+
5+
fix: Serial now uses CRLF rather than just LF for better compatibility

.github/actions/build-frontend/action.yml

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
name: build-frontend
22
description: Builds the frontend and uploads it as an artifact
33
inputs:
4+
pnpm-version:
5+
description: 'pnpm version to use'
6+
required: true
47
node-version:
58
description: 'NodeJS runtime version to use'
69
required: true
@@ -18,21 +21,43 @@ runs:
1821
frontend
1922
path: ${{ github.repository }}
2023

24+
- uses: pnpm/action-setup@v4
25+
name: Install pnpm
26+
with:
27+
version: ${{ inputs.pnpm-version }}
28+
run_install: false
29+
2130
- uses: actions/setup-node@v4
2231
with:
23-
node-version: ${{ inputs.node-version }}
24-
cache: 'npm'
25-
cache-dependency-path: ./frontend/package-lock.json
32+
node-version-file: ./frontend/.nvmrc
33+
cache: 'pnpm'
34+
cache-dependency-path: ./frontend/pnpm-lock.yaml
2635

2736
- name: Install dependencies
2837
working-directory: ./frontend
2938
shell: bash
30-
run: npm ci
39+
run: pnpm install --frozen-lockfile --strict-peer-dependencies
40+
41+
- name: Check
42+
working-directory: ./frontend
43+
shell: bash
44+
run: pnpm run check
45+
46+
# FIXME: Playwirght is not working: Error: browserType.launch: Executable doesn't exist at /home/runner/.cache/ms-playwright/chromium_headless_shell-1161/chrome-linux/headless_shell
47+
# - name: Install playwright
48+
# working-directory: ./frontend
49+
# shell: bash
50+
# run: pnpx playwright install --with-deps
51+
52+
- name: Test
53+
working-directory: ./frontend
54+
shell: bash
55+
run: pnpm test:unit # TODO: Change back to pnpm test when playwright is working
3156

3257
- name: Build
3358
working-directory: ./frontend
3459
shell: bash
35-
run: npm run build
60+
run: pnpm run build
3661

3762
- name: Upload artifacts
3863
uses: actions/upload-artifact@v4
Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,20 @@
11
name: cdn-bump-version
22
description: Uploads version file to CDN
33
inputs:
4-
cf-bucket:
5-
description: Name of the S3 bucket
4+
bunny-stor-hostname:
5+
description: Bunny SFTP Hostname
6+
required: true
7+
bunny-stor-username:
8+
description: Bunny SFTP Username
9+
required: true
10+
bunny-stor-password:
11+
description: Bunny SFTP Password
12+
required: true
13+
bunny-api-key:
14+
description: Bunny API key
15+
required: true
16+
bunny-cdn-url:
17+
description: Bunny pull zone base url e.g. https://firmware.openshock.org (no trailing slash)
618
required: true
719
version:
820
description: 'Version of the release'
@@ -14,9 +26,26 @@ inputs:
1426
runs:
1527
using: composite
1628
steps:
17-
- name: Upload version file
29+
- name: Prepare Upload Folder
1830
shell: bash
1931
run: |
2032
mkdir -p upload
2133
echo "${{ inputs.version }}" >> upload/version-${{ inputs.release-channel }}.txt
22-
rclone copy upload cdn:${{ inputs.cf-bucket }}/
34+
35+
- name: Upload version file
36+
uses: milanmk/actions-file-deployer@master
37+
with:
38+
remote-protocol: "sftp"
39+
remote-host: "${{ inputs.bunny-stor-hostname }}"
40+
remote-user: "${{ inputs.bunny-stor-username }}"
41+
remote-password: "${{ inputs.bunny-stor-password }}"
42+
remote-path: "/"
43+
local-path: "upload"
44+
sync: "full"
45+
46+
- name: Purge CDN cache
47+
shell: bash
48+
run: |
49+
curl -X POST "https://api.bunny.net/purge?url=${{ inputs.bunny-cdn-url }}/version-${{ inputs.release-channel }}.txt" \
50+
-H "Content-Type: application/json" \
51+
-H "AccessKey: ${{ inputs.bunny-api-key }}"
Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,20 @@
11
name: cdn-prepare
2-
description: Prepares the CDN for firmware uploads
2+
description: Bunny sshpass and knowhosts setup
33
inputs:
4-
cf-account-id:
5-
description: Cloudflare Account ID
6-
required: true
7-
cf-access-key-id:
8-
description: Cloudflare Access Key ID
9-
required: true
10-
cf-secret-access-key:
11-
description: Cloudflare Secret Access Key
4+
bunny-ssh-knownhosts:
5+
description: Bunny SFTP Hostname
126
required: true
137

148
runs:
159
using: composite
1610
steps:
17-
- name: Install rclone
11+
- name: Install sshpass
1812
shell: bash
19-
run: sudo apt-get install -y rclone
13+
run: sudo apt-get install -y sshpass
2014

21-
- name: Configure rclone
15+
- name: Configure known hosts
2216
shell: bash
2317
run: |
24-
mkdir -p ~/.config/rclone/
25-
conf=~/.config/rclone/rclone.conf
26-
echo "[cdn]" >> $conf
27-
echo "type = s3" >> $conf
28-
echo "provider = Cloudflare" >> $conf
29-
echo "access_key_id = ${{ inputs.cf-access-key-id }}" >> $conf
30-
echo "secret_access_key = ${{ inputs.cf-secret-access-key }}" >> $conf
31-
echo "endpoint = https://${{ inputs.cf-account-id }}.r2.cloudflarestorage.com" >> $conf
32-
echo "acl = public-read" >> $conf
18+
mkdir -p ~/.ssh
19+
echo "${{ inputs.bunny-ssh-knownhosts }}" >> ~/.ssh/known_hosts
3320

.github/actions/cdn-upload-firmware/action.yml

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
name: cdn-upload-firmware
22
description: Uploads firmware partitions and merged binaries to CDN along with SHA256 checksums
33
inputs:
4-
cf-bucket:
5-
description: Name of the S3 bucket
4+
bunny-stor-hostname:
5+
description: Bunny SFTP Hostname
6+
required: true
7+
bunny-stor-username:
8+
description: Bunny SFTP Username
9+
required: true
10+
bunny-stor-password:
11+
description: Bunny SFTP Password
612
required: true
713
fw-version:
814
description: Firmware version
@@ -43,10 +49,20 @@ runs:
4349
find . -type f -name '*.bin' -exec md5sum {} \; > hashes.md5.txt
4450
find . -type f -name '*.bin' -exec sha256sum {} \; > hashes.sha256.txt
4551
46-
- name: Upload artifacts to CDN
52+
- name: Prepare Upload Folder
4753
shell: bash
4854
run: |
4955
mkdir -p upload
5056
mv *.bin upload/
5157
mv hashes.*.txt upload/
52-
rclone copy upload 'cdn:${{ inputs.cf-bucket }}/${{ inputs.fw-version }}/${{ inputs.board }}/'
58+
59+
- name: Upload artifacts to CDN
60+
uses: milanmk/actions-file-deployer@master
61+
with:
62+
remote-protocol: "sftp"
63+
remote-host: "${{ inputs.bunny-stor-hostname }}"
64+
remote-user: "${{ inputs.bunny-stor-username }}"
65+
remote-password: "${{ inputs.bunny-stor-password }}"
66+
remote-path: "/${{ inputs.fw-version }}/${{ inputs.board }}"
67+
local-path: "upload"
68+
sync: "full"
Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
name: cdn-upload-version-info
22
description: Uploads version specific info to CDN
33
inputs:
4-
cf-bucket:
5-
description: Name of the S3 bucket
4+
bunny-stor-hostname:
5+
description: Bunny SFTP Hostname
6+
required: true
7+
bunny-stor-username:
8+
description: Bunny SFTP Username
9+
required: true
10+
bunny-stor-password:
11+
description: Bunny SFTP Password
612
required: true
713
fw-version:
814
description: Firmware version
@@ -17,14 +23,25 @@ inputs:
1723
runs:
1824
using: composite
1925
steps:
20-
- name: Create boards.txt
26+
27+
- name: Prepare Upload Folder
2128
shell: bash
2229
run: |
23-
echo -e '${{ inputs.boards }}' >> boards.txt
30+
rm -rf upload/
31+
mkdir -p upload/
2432
25-
- name: Upload artifacts to CDN
33+
- name: Create boards.txt
2634
shell: bash
2735
run: |
28-
mkdir -p upload
29-
mv boards.txt upload/
30-
rclone copy upload 'cdn:${{ inputs.cf-bucket }}/${{ inputs.fw-version }}/${{ inputs.board }}/'
36+
echo -e '${{ inputs.boards }}' >> upload/boards.txt
37+
38+
- name: Upload artifacts to CDN
39+
uses: milanmk/actions-file-deployer@master
40+
with:
41+
remote-protocol: "sftp"
42+
remote-host: "${{ inputs.bunny-stor-hostname }}"
43+
remote-user: "${{ inputs.bunny-stor-username }}"
44+
remote-password: "${{ inputs.bunny-stor-password }}"
45+
remote-path: "/${{ inputs.fw-version }}/"
46+
local-path: "upload"
47+
sync: "full"

.github/scripts/get-vars.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
const fs = require('fs');
2-
const ini = require('ini');
3-
const semver = require('semver');
4-
const core = require('@actions/core');
5-
const child_process = require('child_process');
1+
import fs from 'fs';
2+
import ini from 'ini';
3+
import semver from 'semver';
4+
import core from '@actions/core';
5+
import child_process from 'child_process';
66

77
// Get branch name
88
const gitRef = process.env.GITHUB_REF;

0 commit comments

Comments
 (0)