Skip to content

Commit

Permalink
Merge branch 'develop' into feature/support-s3-dorx
Browse files Browse the repository at this point in the history
  • Loading branch information
hhvrc committed Jan 14, 2024
2 parents 6a297ad + ea4e2b4 commit d1bb623
Show file tree
Hide file tree
Showing 165 changed files with 8,616 additions and 3,297 deletions.
3 changes: 2 additions & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
OPENSHOCK_API_DOMAIN=api.shocklink.net
OPENSHOCK_FW_CDN_DOMAIN=firmware.openshock.org
OPENSHOCK_FW_VERSION=0.0.0-unknown
OPENSHOCK_FW_HOSTNAME=OpenShock
OPENSHOCK_FW_AP_PREFIX=OpenShock-
OPENSHOCK_FW_AP_PREFIX=OpenShock-
16 changes: 12 additions & 4 deletions .github/actions/build-firmware/action.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@

name: build-firmware
description: Builds the firmware partitions and uploads them as an artifact
inputs:
python-version:
description: 'Python version to use'
required: true
description: 'Python version to use'
board:
required: true
description: 'Board name to build'
version:
required: true
description: 'Current firmware version'
skip-checkout:
description: 'If true, skips checkout'
required: false
Expand All @@ -30,7 +32,7 @@ runs:
- uses: actions/setup-python@v4
with:
python-version: ${{ inputs.python-version }}
cache: "pip"
cache: 'pip'

- name: Install python dependencies
shell: bash
Expand All @@ -40,9 +42,15 @@ runs:
working-directory: .
shell: bash
run: pio run -e ${{ inputs.board }}
env:
OPENSHOCK_API_DOMAIN: api.openshock.net
OPENSHOCK_FW_VERSION: ${{ inputs.version }}
OPENSHOCK_FW_GIT_REF: ${{ github.ref }}
OPENSHOCK_FW_GIT_COMMIT: ${{ github.sha }}
OPENSHOCK_FW_BUILD_DATE: ${{ github.event.head_commit.timestamp }}

- name: Upload build artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: firmware_build_${{ inputs.board }}
path: .pio/build/${{ inputs.board }}/*.bin
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/build-frontend/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ runs:
frontend
path: ${{ github.repository }}

- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}
cache: 'npm'
Expand All @@ -35,7 +35,7 @@ runs:
run: npm run build

- name: Upload artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: frontend
path: frontend/build/*
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/build-staticfs/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ runs:
run: pip install -r requirements.txt

- name: Download built frontend
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: frontend
path: frontend/build/
Expand All @@ -47,7 +47,7 @@ runs:
run: mv .pio/build/fs/littlefs.bin staticfs.bin

- name: Upload internal filesystem artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: firmware_staticfs
path: staticfs.bin
Expand Down
10 changes: 4 additions & 6 deletions .github/actions/cdn-bump-version/action.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
name: cnd-bump-version
name: cdn-bump-version
description: Uploads version file to CDN
inputs:
cf-bucket:
description: Name of the S3 bucket
required: true
version:
description: Version to upload
description: 'Version of the release'
required: true
release-channel:
description: 'Release channel that describes this upload'
required: false
default: 'none'
required: true

runs:
using: composite
steps:

- name: Upload version file
shell: bash
run: |
mkdir upload
mkdir -p upload
echo "${{ inputs.version }}" >> upload/version-${{ inputs.release-channel }}.txt
rclone copy upload cdn:${{ inputs.cf-bucket }}/
2 changes: 1 addition & 1 deletion .github/actions/cdn-prepare/action.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: cnd-prepare
name: cdn-prepare
description: Prepares the CDN for firmware uploads
inputs:
cf-account-id:
Expand Down
20 changes: 8 additions & 12 deletions .github/actions/cdn-upload-firmware/action.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
name: cnd-upload-firmware
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
required: true
version:
description: Version to upload
required: true
release-channel:
description: 'Release channel that describes this upload'
required: false
default: 'none'
required: true
board:
description: 'Board to upload'
required: true
Expand All @@ -19,19 +15,19 @@ runs:
using: composite
steps:
- name: Download static filesystem partition
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: firmware_staticfs
path: .

- name: Download firmware partitions
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: firmware_build_${{ inputs.board }}
path: .

- name: Download merged firmware binary
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: firmware_merged_${{ inputs.board }}
path: .
Expand All @@ -44,13 +40,13 @@ runs:
- name: Generate SHA256 checksums
shell: bash
run: |
find . -type f -name '*.bin' -exec sha256sum {} \; > hashes.md5.txt
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
shell: bash
run: |
mkdir upload
mkdir -p upload
mv *.bin upload/
mv hashes.*.txt upload/
rclone copy upload cdn:${{ inputs.cf-bucket }}/${{ inputs.version }}/${{ inputs.board }}/
rclone copy upload 'cdn:${{ inputs.cf-bucket }}/${{ inputs.release-channel }}/${{ inputs.board }}/'
10 changes: 5 additions & 5 deletions .github/actions/cdn-upload-version-info/action.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: cnd-upload-version-info
name: cdn-upload-version-info
description: Uploads version specific info to CDN
inputs:
cf-bucket:
description: Name of the S3 bucket
required: true
version:
description: Version to upload
release-channel:
description: 'Release channel that describes this upload'
required: true
boards:
description: 'List of boards, separated by newlines'
Expand All @@ -22,6 +22,6 @@ runs:
- name: Upload artifacts to CDN
shell: bash
run: |
mkdir upload
mkdir -p upload
mv boards.txt upload/
rclone copy upload cdn:${{ inputs.cf-bucket }}/${{ inputs.version }}/${{ inputs.board }}/
rclone copy upload 'cdn:${{ inputs.cf-bucket }}/${{ inputs.release-channel }}/${{ inputs.board }}/'
11 changes: 7 additions & 4 deletions .github/actions/merge-partitions/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ inputs:
python-version:
description: 'Python version to use'
required: true
release-channel:
description: 'Release channel that describes this upload'
required: true
board:
description: 'Board name to merge partitions for'
required: true
Expand Down Expand Up @@ -33,23 +36,23 @@ runs:
run: pip install esptool

- name: Download static filesystem partition
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: firmware_staticfs

- name: Download firmware partitions
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: firmware_build_${{ inputs.board }}

- name: Merge partitions
shell: bash
run: |
python scripts/merge_image.py ${{ inputs.board }}
mv merged.bin OpenShock_${{ inputs.board }}_${{ !contains(github.ref_name, '/') && github.ref_name || 'unknown' }}.bin
mv merged.bin OpenShock_${{ inputs.board }}_${{ inputs.release-channel }}.bin
- name: Upload merged firmware binary
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: firmware_merged_${{ inputs.board }}
path: OpenShock_${{ inputs.board }}_*.bin
Expand Down
1 change: 1 addition & 0 deletions .github/scripts/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
Loading

0 comments on commit d1bb623

Please sign in to comment.