Skip to content

Commit 5379918

Browse files
committed
Merge branch 'develop' into feature/ditch-arduino-serial
2 parents 7745c8e + 611343b commit 5379918

File tree

135 files changed

+6854
-6838
lines changed

Some content is hidden

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

135 files changed

+6854
-6838
lines changed

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

Lines changed: 29 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,42 @@ 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+
- name: Install playwright
47+
working-directory: ./frontend
48+
shell: bash
49+
run: pnpx playwright install --with-deps
50+
51+
- name: Test
52+
working-directory: ./frontend
53+
shell: bash
54+
run: pnpm test
3155

3256
- name: Build
3357
working-directory: ./frontend
3458
shell: bash
35-
run: npm run build
59+
run: pnpm run build
3660

3761
- name: Upload artifacts
3862
uses: actions/upload-artifact@v4

.github/actions/cdn-bump-version/action.yml

Lines changed: 22 additions & 3 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'
@@ -19,4 +31,11 @@ runs:
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+
sshpass -p "${{ inputs.bunny-stor-password }}" scp -v -r upload/* ${{ inputs.bunny-stor-username }}@${{ inputs.bunny-stor-hostname }}:/
35+
36+
- name: Purge CDN cache
37+
shell: bash
38+
run: |
39+
curl -X POST "https://api.bunny.net/purge?url=${{ inputs.bunny-cdn-url }}/version-${{ inputs.release-channel }}.txt" \
40+
-H "Content-Type: application/json" \
41+
-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: 9 additions & 3 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
@@ -49,4 +55,4 @@ runs:
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+
sshpass -p "${{ inputs.bunny-stor-password }}" scp -r upload/ ${{ inputs.bunny-stor-username }}@${{ inputs.bunny-stor-hostname }}:/${{ inputs.fw-version }}/${{ inputs.board }}

.github/actions/cdn-upload-version-info/action.yml

Lines changed: 9 additions & 3 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
@@ -27,4 +33,4 @@ runs:
2733
run: |
2834
mkdir -p upload
2935
mv boards.txt upload/
30-
rclone copy upload 'cdn:${{ inputs.cf-bucket }}/${{ inputs.fw-version }}/${{ inputs.board }}/'
36+
sshpass -p "${{ inputs.bunny-stor-password }}" scp -r upload/* ${{ inputs.bunny-stor-username }}@${{ inputs.bunny-stor-hostname }}:/${{ inputs.fw-version }}/${{ inputs.board }}

.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)