Skip to content

Commit

Permalink
Merge branch 'develop' into feature/svelte-5
Browse files Browse the repository at this point in the history
  • Loading branch information
hhvrc committed Jan 8, 2025
2 parents eb150b0 + 974d3c5 commit 1a4cd88
Show file tree
Hide file tree
Showing 145 changed files with 3,208 additions and 1,906 deletions.
25 changes: 22 additions & 3 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 @@ -19,4 +31,11 @@ runs:
run: |
mkdir -p upload
echo "${{ inputs.version }}" >> upload/version-${{ inputs.release-channel }}.txt
rclone copy upload cdn:${{ inputs.cf-bucket }}/
sshpass -p "${{ inputs.bunny-stor-password }}" scp -v -r upload/* ${{ inputs.bunny-stor-username }}@${{ inputs.bunny-stor-hostname }}:/
- 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
12 changes: 9 additions & 3 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 @@ -49,4 +55,4 @@ runs:
mkdir -p upload
mv *.bin upload/
mv hashes.*.txt upload/
rclone copy upload 'cdn:${{ inputs.cf-bucket }}/${{ inputs.fw-version }}/${{ inputs.board }}/'
sshpass -p "${{ inputs.bunny-stor-password }}" scp -r upload/ ${{ inputs.bunny-stor-username }}@${{ inputs.bunny-stor-hostname }}:/${{ inputs.fw-version }}/${{ inputs.board }}
12 changes: 9 additions & 3 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 @@ -27,4 +33,4 @@ runs:
run: |
mkdir -p upload
mv boards.txt upload/
rclone copy upload 'cdn:${{ inputs.cf-bucket }}/${{ inputs.fw-version }}/${{ inputs.board }}/'
sshpass -p "${{ inputs.bunny-stor-password }}" scp -r upload/* ${{ inputs.bunny-stor-username }}@${{ inputs.bunny-stor-hostname }}:/${{ inputs.fw-version }}/${{ inputs.board }}
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
16 changes: 8 additions & 8 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,33 +19,33 @@
"@eslint/compat": "^1.2.4",
"@playwright/test": "^1.49.1",
"@sveltejs/adapter-static": "^3.0.8",
"@sveltejs/kit": "^2.14.0",
"@sveltejs/kit": "^2.15.2",
"@sveltejs/vite-plugin-svelte": "^5.0.3",
"@tailwindcss/forms": "^0.5.9",
"@tailwindcss/typography": "^0.5.15",
"@tailwindcss/forms": "^0.5.10",
"@tailwindcss/typography": "^0.5.16",
"autoprefixer": "^10.4.20",
"bits-ui": "1.0.0-next.74",
"clsx": "^2.1.1",
"eslint": "^9.17.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-svelte": "^2.46.1",
"flatbuffers": "^24.3.25",
"flatbuffers": "^24.12.23",
"globals": "^15.14.0",
"lucide-svelte": "^0.469.0",
"mode-watcher": "^0.5.0",
"prettier": "^3.4.2",
"prettier-plugin-svelte": "^3.3.2",
"prettier-plugin-tailwindcss": "^0.6.9",
"svelte": "^5.15.0",
"svelte": "^5.17.0",
"svelte-check": "^4.1.1",
"svelte-sonner": "^0.3.28",
"tailwind-merge": "^2.5.5",
"tailwind-merge": "^2.6.0",
"tailwind-variants": "^0.3.0",
"tailwindcss": "^3.4.17",
"tailwindcss-animate": "^1.0.7",
"typescript": "^5.7.2",
"typescript-eslint": "^8.18.1",
"vite": "^6.0.5",
"typescript-eslint": "^8.19.1",
"vite": "^6.0.7",
"vitest": "^2.1.8"
},
"engines": {
Expand Down
Loading

1 comment on commit 1a4cd88

@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: 19 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
  • src/radio/rmt/T330Encoder.cpp
  • src/serial/command_handlers/CommandEntry.cpp

Have any feedback or feature suggestions? Share it here.

Please sign in to comment.