Skip to content

Commit

Permalink
Merge branch 'develop' into experimental/custom-json-serializer
Browse files Browse the repository at this point in the history
  • Loading branch information
hhvrc committed Feb 4, 2025
2 parents 910ef06 + 8651074 commit 88056fe
Show file tree
Hide file tree
Showing 258 changed files with 7,148 additions and 4,031 deletions.
37 changes: 33 additions & 4 deletions .github/actions/cdn-bump-version/action.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
name: cdn-bump-version
description: Uploads version file to CDN
inputs:
cf-bucket:
description: Name of the S3 bucket
bunny-stor-hostname:
description: Bunny SFTP Hostname
required: true
bunny-stor-username:
description: Bunny SFTP Username
required: true
bunny-stor-password:
description: Bunny SFTP Password
required: true
bunny-api-key:
description: Bunny API key
required: true
bunny-cdn-url:
description: Bunny pull zone base url e.g. https://firmware.openshock.org (no trailing slash)
required: true
version:
description: 'Version of the release'
Expand All @@ -14,9 +26,26 @@ inputs:
runs:
using: composite
steps:
- name: Upload version file
- name: Prepare Upload Folder
shell: bash
run: |
mkdir -p upload
echo "${{ inputs.version }}" >> upload/version-${{ inputs.release-channel }}.txt
rclone copy upload cdn:${{ inputs.cf-bucket }}/
- name: Upload version file
uses: milanmk/actions-file-deployer@master
with:
remote-protocol: "sftp"
remote-host: "${{ inputs.bunny-stor-hostname }}"
remote-user: "${{ inputs.bunny-stor-username }}"
remote-password: "${{ inputs.bunny-stor-password }}"
remote-path: "/"
local-path: "upload"
sync: "full"

- name: Purge CDN cache
shell: bash
run: |
curl -X POST "https://api.bunny.net/purge?url=${{ inputs.bunny-cdn-url }}/version-${{ inputs.release-channel }}.txt" \
-H "Content-Type: application/json" \
-H "AccessKey: ${{ inputs.bunny-api-key }}"
29 changes: 8 additions & 21 deletions .github/actions/cdn-prepare/action.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,20 @@
name: cdn-prepare
description: Prepares the CDN for firmware uploads
description: Bunny sshpass and knowhosts setup
inputs:
cf-account-id:
description: Cloudflare Account ID
required: true
cf-access-key-id:
description: Cloudflare Access Key ID
required: true
cf-secret-access-key:
description: Cloudflare Secret Access Key
bunny-ssh-knownhosts:
description: Bunny SFTP Hostname
required: true

runs:
using: composite
steps:
- name: Install rclone
- name: Install sshpass
shell: bash
run: sudo apt-get install -y rclone
run: sudo apt-get install -y sshpass

- name: Configure rclone
- name: Configure known hosts
shell: bash
run: |
mkdir -p ~/.config/rclone/
conf=~/.config/rclone/rclone.conf
echo "[cdn]" >> $conf
echo "type = s3" >> $conf
echo "provider = Cloudflare" >> $conf
echo "access_key_id = ${{ inputs.cf-access-key-id }}" >> $conf
echo "secret_access_key = ${{ inputs.cf-secret-access-key }}" >> $conf
echo "endpoint = https://${{ inputs.cf-account-id }}.r2.cloudflarestorage.com" >> $conf
echo "acl = public-read" >> $conf
mkdir -p ~/.ssh
echo "${{ inputs.bunny-ssh-knownhosts }}" >> ~/.ssh/known_hosts
24 changes: 20 additions & 4 deletions .github/actions/cdn-upload-firmware/action.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
name: cdn-upload-firmware
description: Uploads firmware partitions and merged binaries to CDN along with SHA256 checksums
inputs:
cf-bucket:
description: Name of the S3 bucket
bunny-stor-hostname:
description: Bunny SFTP Hostname
required: true
bunny-stor-username:
description: Bunny SFTP Username
required: true
bunny-stor-password:
description: Bunny SFTP Password
required: true
fw-version:
description: Firmware version
Expand Down Expand Up @@ -43,10 +49,20 @@ runs:
find . -type f -name '*.bin' -exec md5sum {} \; > hashes.md5.txt
find . -type f -name '*.bin' -exec sha256sum {} \; > hashes.sha256.txt
- name: Upload artifacts to CDN
- name: Prepare Upload Folder
shell: bash
run: |
mkdir -p upload
mv *.bin upload/
mv hashes.*.txt upload/
rclone copy upload 'cdn:${{ inputs.cf-bucket }}/${{ inputs.fw-version }}/${{ inputs.board }}/'
- name: Upload artifacts to CDN
uses: milanmk/actions-file-deployer@master
with:
remote-protocol: "sftp"
remote-host: "${{ inputs.bunny-stor-hostname }}"
remote-user: "${{ inputs.bunny-stor-username }}"
remote-password: "${{ inputs.bunny-stor-password }}"
remote-path: "/${{ inputs.fw-version }}/${{ inputs.board }}"
local-path: "upload"
sync: "full"
33 changes: 25 additions & 8 deletions .github/actions/cdn-upload-version-info/action.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
name: cdn-upload-version-info
description: Uploads version specific info to CDN
inputs:
cf-bucket:
description: Name of the S3 bucket
bunny-stor-hostname:
description: Bunny SFTP Hostname
required: true
bunny-stor-username:
description: Bunny SFTP Username
required: true
bunny-stor-password:
description: Bunny SFTP Password
required: true
fw-version:
description: Firmware version
Expand All @@ -17,14 +23,25 @@ inputs:
runs:
using: composite
steps:
- name: Create boards.txt

- name: Prepare Upload Folder
shell: bash
run: |
echo -e '${{ inputs.boards }}' >> boards.txt
rm -rf upload/
mkdir -p upload/
- name: Upload artifacts to CDN
- name: Create boards.txt
shell: bash
run: |
mkdir -p upload
mv boards.txt upload/
rclone copy upload 'cdn:${{ inputs.cf-bucket }}/${{ inputs.fw-version }}/${{ inputs.board }}/'
echo -e '${{ inputs.boards }}' >> upload/boards.txt
- name: Upload artifacts to CDN
uses: milanmk/actions-file-deployer@master
with:
remote-protocol: "sftp"
remote-host: "${{ inputs.bunny-stor-hostname }}"
remote-user: "${{ inputs.bunny-stor-username }}"
remote-password: "${{ inputs.bunny-stor-password }}"
remote-path: "/${{ inputs.fw-version }}/"
local-path: "upload"
sync: "full"
2 changes: 1 addition & 1 deletion .github/scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"@actions/core": "^1.10.1",
"@actions/github": "^6.0.0",
"ini": "^5.0.0",
"semver": "^7.6.0"
"semver": "^7.7.0"
},
"engines": {
"node": ">=20.18",
Expand Down
18 changes: 9 additions & 9 deletions .github/scripts/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 15 additions & 13 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:

build-staticfs:
runs-on: ubuntu-latest
needs: build-frontend
needs: [getvars, build-frontend]

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -114,14 +114,14 @@ jobs:
# Set up rclone for CDN uploads.
- uses: ./.github/actions/cdn-prepare
with:
cf-account-id: ${{ vars.S3_ACCOUNT_ID }}
cf-access-key-id: ${{ vars.S3_ACCESS_KEY_ID }}
cf-secret-access-key: ${{ secrets.S3_SECRET_ACCESS_KEY }}
bunny-ssh-knownhosts: ${{ vars.BUNNY_SSH_KNOWNHOSTS }}

# Upload firmware to CDN.
- uses: ./.github/actions/cdn-upload-firmware
with:
cf-bucket: ${{ vars.S3_BUCKET }}
bunny-stor-hostname: ${{ vars.BUNNY_STOR_HOSTNAME }}
bunny-stor-username: ${{ secrets.BUNNY_STOR_USERNAME }}
bunny-stor-password: ${{ secrets.BUNNY_STOR_PASSWORD }}
fw-version: ${{ needs.getvars.outputs.version }}
board: ${{ matrix.board }}

Expand All @@ -140,14 +140,14 @@ jobs:
# Set up rclone for CDN uploads.
- uses: ./.github/actions/cdn-prepare
with:
cf-account-id: ${{ vars.S3_ACCOUNT_ID }}
cf-access-key-id: ${{ vars.S3_ACCESS_KEY_ID }}
cf-secret-access-key: ${{ secrets.S3_SECRET_ACCESS_KEY }}
bunny-ssh-knownhosts: ${{ vars.BUNNY_SSH_KNOWNHOSTS }}

# Upload firmware to CDN.
- uses: ./.github/actions/cdn-upload-version-info
with:
cf-bucket: ${{ vars.S3_BUCKET }}
bunny-stor-hostname: ${{ vars.BUNNY_STOR_HOSTNAME }}
bunny-stor-username: ${{ secrets.BUNNY_STOR_USERNAME }}
bunny-stor-password: ${{ secrets.BUNNY_STOR_PASSWORD }}
fw-version: ${{ needs.getvars.outputs.version }}
release-channel: ${{ needs.getvars.outputs.release-channel }}
boards: ${{ needs.getvars.outputs.board-list }}
Expand All @@ -166,14 +166,16 @@ jobs:
# Set up rclone for CDN uploads.
- uses: ./.github/actions/cdn-prepare
with:
cf-account-id: ${{ vars.S3_ACCOUNT_ID }}
cf-access-key-id: ${{ vars.S3_ACCESS_KEY_ID }}
cf-secret-access-key: ${{ secrets.S3_SECRET_ACCESS_KEY }}
bunny-ssh-knownhosts: ${{ vars.BUNNY_SSH_KNOWNHOSTS }}

# Upload firmware to CDN.
- uses: ./.github/actions/cdn-bump-version
with:
cf-bucket: ${{ vars.S3_BUCKET }}
bunny-stor-hostname: ${{ vars.BUNNY_STOR_HOSTNAME }}
bunny-stor-username: ${{ secrets.BUNNY_STOR_USERNAME }}
bunny-stor-password: ${{ secrets.BUNNY_STOR_PASSWORD }}
bunny-api-key: ${{ secrets.BUNNY_APIKEY }}
bunny-cdn-url: ${{ vars.BUNNY_CDN_URL }}
version: ${{ needs.getvars.outputs.version }}
release-channel: ${{ needs.getvars.outputs.release-channel }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cpp-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:

- uses: ./.github/actions/build-compilationdb
with:
board: OpenShock-Core-V2 # Doesn't matter, just need the compilation database
version: 0.0.0-test+build # Doesn't matter, just need the compilation database
skip-checkout: true

- uses: cpp-linter/cpp-linter-action@v2
Expand Down
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
# Version 1.4.0 Release Notes

This release is packed with bugfixes, optimizations, code cleanup, prepwork for ESP-IDF, and some features!

## Highlights

- Add support for configuring hostname of ESP via Serial.
- Add support for configuring Emergency Stop via Captive Portal and Serial.
- Report available GPIO pins to Captive Portal Frontend.
- Massively refactor serial command handler.

## Optimizations

- Bump platform-espressif32 to version 6.9.
- Start using C++17 features including std::string_view.
- Clean up platformio.ini file.
- Lots of miscellanious code cleanup.
- Implement custom zero-copy type conversion methods with better error checking.
- Reduce log spam by the arduino library.
- Improve error handling of gpio pin selection.
- Attempt to make more sense out of the 998DR protocol serializer.

# Version 1.4.0-rc.2 Release Notes

Fixed EStop debouncing logic.
Expand Down
Empty file removed data/.gitkeep
Empty file.
7 changes: 6 additions & 1 deletion frontend/.eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ node_modules
.env.*
!.env.example

# Ignore files for PNPM, NPM and YARN
# Package Managers
pnpm-lock.yaml
package-lock.json
yarn.lock

# Generated or imported files
/components.json
/src/lib/_fbs
/src/lib/components/ui
30 changes: 0 additions & 30 deletions frontend/.eslintrc.cjs

This file was deleted.

Loading

1 comment on commit 88056fe

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cpp-Linter Report ⚠️

Some files did not pass the configured checks!

clang-format (v18.1.3) reports: 20 file(s) not formatted
  • include/Checksum.h
  • include/ShockerCommandType.h
  • include/serialization/_fbs/FirmwareBootType_generated.h
  • include/serialization/_fbs/GatewayToHubMessage_generated.h
  • include/serialization/_fbs/HubConfig_generated.h
  • include/serialization/_fbs/HubToGatewayMessage_generated.h
  • include/serialization/_fbs/HubToLocalMessage_generated.h
  • include/serialization/_fbs/LocalToHubMessage_generated.h
  • include/serialization/_fbs/OtaUpdateProgressTask_generated.h
  • include/serialization/_fbs/SemVer_generated.h
  • include/serialization/_fbs/ShockerCommandType_generated.h
  • include/serialization/_fbs/ShockerModelType_generated.h
  • include/serialization/_fbs/WifiAuthMode_generated.h
  • include/serialization/_fbs/WifiNetworkEventType_generated.h
  • include/serialization/_fbs/WifiNetwork_generated.h
  • include/serialization/_fbs/WifiScanStatus_generated.h
  • include/util/FnProxy.h
  • include/util/HexUtils.h
  • src/serial/command_handlers/CommandEntry.cpp
  • src/util/StringUtils.cpp

Have any feedback or feature suggestions? Share it here.

Please sign in to comment.