Skip to content

Commit

Permalink
Merge pull request #320 from J-A-A-M/esp32s3
Browse files Browse the repository at this point in the history
Нова сумісність: ESP32-S3, ESP32-C3
  • Loading branch information
v00g100skr authored Feb 10, 2025
2 parents aecadf6 + eaf1b1d commit 76b1639
Show file tree
Hide file tree
Showing 28 changed files with 586 additions and 227 deletions.
30 changes: 28 additions & 2 deletions .github/workflows/beta_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
uses: actions/checkout@v4
- name: Replace version in firmware source
run: |
sed -i 's/VERSION = ".*";/VERSION = "${{ env.BETA_VERSION }}";/' ${{ github.workspace }}/firmware/src/JaamFirmware.cpp
sed -i 's/VERSION=".*"/VERSION="${{ env.BETA_VERSION }}"/' ${{ github.workspace }}/firmware/platformio.ini
- name: Compile firmware
uses: ./.github/workflows/firmware-compile
- name: Copy release files to bin folder
Expand All @@ -36,18 +36,44 @@ jobs:
- name: Leave only 10 recent BETA builds
run: |
bash ${{ github.workspace }}/deploy/remove_old_bins.sh ${{ github.workspace }}/bin_beta/ 10
- name: Compile firmware s3
uses: ./.github/workflows/firmware-compile
with:
project-env: firmware_esp32s3
- name: Copy release files to bin folder
run: |
mkdir -p ${{ github.workspace }}/bin_beta/s3/
cp -f ${{ github.workspace }}/firmware/.pio/build/firmware_esp32s3/firmware.bin ${{ github.workspace }}/bin_beta/s3/${{ env.BETA_VERSION }}.bin
cp -f ${{ github.workspace }}/firmware/.pio/build/firmware_esp32s3/firmware.bin ${{ github.workspace }}/JAAM_S3_${{ env.BETA_VERSION }}.bin
- name: Leave only 10 recent BETA S3 builds
run: |
bash ${{ github.workspace }}/deploy/remove_old_bins.sh ${{ github.workspace }}/bin_beta/s3/ 10
- name: Compile firmware c3
uses: ./.github/workflows/firmware-compile
with:
project-env: firmware_esp32c3
- name: Copy release files to bin folder
run: |
mkdir -p ${{ github.workspace }}/bin_beta/c3/
cp -f ${{ github.workspace }}/firmware/.pio/build/firmware_esp32c3/firmware.bin ${{ github.workspace }}/bin_beta/c3/${{ env.BETA_VERSION }}.bin
cp -f ${{ github.workspace }}/firmware/.pio/build/firmware_esp32c3/firmware.bin ${{ github.workspace }}/JAAM_C3_${{ env.BETA_VERSION }}.bin
- name: Leave only 10 recent BETA C3 builds
run: |
bash ${{ github.workspace }}/deploy/remove_old_bins.sh ${{ github.workspace }}/bin_beta/c3/ 10
- name: Upload flasher to Github Pages
uses: ./.github/workflows/upload-pages
with:
beta_binary_path: ${{ github.workspace }}/JAAM_${{ env.BETA_VERSION }}.bin
beta_s3_binary_path: ${{ github.workspace }}/JAAM_S3_${{ env.BETA_VERSION }}.bin
beta_c3_binary_path: ${{ github.workspace }}/JAAM_C3_${{ env.BETA_VERSION }}.bin
version: ${{ inputs.release-version }}
beta_build: ${{ github.run_number }}
- name: Commit changes
id: commit_changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Beta ${{ env.BETA_VERSION }}"
file_pattern: ${{ github.workspace }}/firmware/src/JaamFirmware.cpp ${{ github.workspace }}/bin_beta/ ${{ github.workspace }}/flasher/
file_pattern: ${{ github.workspace }}/firmware/platformio.ini ${{ github.workspace }}/bin_beta/ ${{ github.workspace }}/flasher/
- name: Create Beta Pre Release
uses: ncipollo/release-action@v1
with:
Expand Down
68 changes: 54 additions & 14 deletions .github/workflows/compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
- uses: actions/checkout@v4
- name: Compile firmware
uses: ./.github/workflows/firmware-compile
with:
project-folder: firmware
- name: Copy bin file
run: |
cp -f ${{ github.workspace }}/firmware/.pio/build/firmware/firmware.bin ${{ github.workspace }}/firmware.bin
Expand All @@ -25,20 +23,49 @@
with:
name: firmware.bin
path: ${{ github.workspace }}/firmware.bin
compile_firmware_esp32s3:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Compile firmware esp32s3
uses: ./.github/workflows/firmware-compile
with:
project-env: firmware_esp32s3
- name: Copy bin file
run: |
cp -f ${{ github.workspace }}/firmware/.pio/build/firmware_esp32s3/firmware.bin ${{ github.workspace }}/firmware-esp32s3.bin
- name: Upload firmware esp32s3
uses: actions/upload-artifact@v4
with:
name: firmware-esp32s3.bin
path: ${{ github.workspace }}/firmware-esp32s3.bin
compile_firmware_esp32c3:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Compile firmware esp32c3
uses: ./.github/workflows/firmware-compile
with:
project-env: firmware_esp32c3
- name: Copy bin file
run: |
cp -f ${{ github.workspace }}/firmware/.pio/build/firmware_esp32c3/firmware.bin ${{ github.workspace }}/firmware-esp32c3.bin
- name: Upload firmware esp32c3
uses: actions/upload-artifact@v4
with:
name: firmware-esp32c3.bin
path: ${{ github.workspace }}/firmware-esp32c3.bin
compile_firmware_lite:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Switch to LITE version
run: |
sed -i 's/#define LITE ./#define LITE 1/' ${{ github.workspace }}/firmware/src/Definitions.h
- name: Compile firmware
- name: Compile lite firmware
uses: ./.github/workflows/firmware-compile
with:
project-folder: firmware
project-env: firmware_lite
- name: Copy bin file
run: |
cp -f ${{ github.workspace }}/firmware/.pio/build/firmware/firmware.bin ${{ github.workspace }}/firmware-lite.bin
cp -f ${{ github.workspace }}/firmware/.pio/build/firmware_lite/firmware.bin ${{ github.workspace }}/firmware-lite.bin
- name: Upload firmware lite
uses: actions/upload-artifact@v4
with:
Expand All @@ -48,22 +75,34 @@
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Switch to TEST_MODE build
run: |
sed -i 's/#define LITE ./#define LITE 0/' ${{ github.workspace }}/firmware/src/Definitions.h
sed -i 's/#define TEST_MODE ./#define TEST_MODE 1/' ${{ github.workspace }}/firmware/src/Definitions.h
- name: Compile test firmware
uses: ./.github/workflows/firmware-compile
with:
project-folder: firmware
project-env: firmware_test
- name: Copy bin file
run: |
cp -f ${{ github.workspace }}/firmware/.pio/build/firmware/firmware.bin ${{ github.workspace }}/firmware-jaam2-test.bin
cp -f ${{ github.workspace }}/firmware/.pio/build/firmware_test/firmware.bin ${{ github.workspace }}/firmware-jaam2-test.bin
- name: Upload JAAM 2 test firmware
uses: actions/upload-artifact@v4
with:
name: firmware-jaam2-test.bin
path: ${{ github.workspace }}/firmware-jaam2-test.bin
compile_firmware_telnet:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Compile firmware with telnet
uses: ./.github/workflows/firmware-compile
with:
project-env: firmware_telnet
- name: Copy bin file
run: |
cp -f ${{ github.workspace }}/firmware/.pio/build/firmware_telnet/firmware.bin ${{ github.workspace }}/firmware-telnet.bin
- name: Upload firmware with telnet
uses: actions/upload-artifact@v4
with:
name: firmware-telnet.bin
path: ${{ github.workspace }}/firmware-telnet.bin
# check_firmware:
# runs-on: ubuntu-latest
# steps:
Expand All @@ -80,6 +119,7 @@
uses: ./.github/workflows/firmware-compile
with:
project-folder: updater
project-env: updater
- name: Copy bin file
run: |
cp -f ${{ github.workspace }}/updater/.pio/build/updater/firmware.bin ${{ github.workspace }}/updater.bin
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/firmware-compile/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ inputs:
project-folder:
description: 'Project folder'
default: 'firmware'
project-env:
description: 'Project environment to build'
default: 'firmware'
permissions:
contents: read
pull-requests: write
Expand All @@ -24,4 +27,4 @@ runs:
run: pip install --upgrade platformio
- name: Build ${{ inputs.project-folder }}
shell: bash
run: pio run -d ${{ inputs.project-folder }}
run: pio run -d ${{ inputs.project-folder }} -e ${{ inputs.project-env }}
81 changes: 73 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
uses: actions/checkout@v4
- name: Replace version in firmware source
run: |
sed -i 's/VERSION = ".*";/VERSION = "${{ inputs.release-version }}";/' ${{ github.workspace }}/firmware/src/JaamFirmware.cpp
sed -i 's/VERSION=".*"/VERSION="${{ inputs.release-version }}"/' ${{ github.workspace }}/firmware/platformio.ini
- name: Compile firmware
uses: ./.github/workflows/firmware-compile
- name: Copy bin to upload
Expand All @@ -31,28 +31,71 @@ jobs:
with:
name: JAAM_${{ inputs.release-version }}.bin
path: ${{ github.workspace }}/JAAM_${{ inputs.release-version }}.bin
build_s3:
if: ${{ github.ref_name == 'master' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Replace version in firmware source
run: |
sed -i 's/VERSION=".*"/VERSION="${{ inputs.release-version }}"/' ${{ github.workspace }}/firmware/platformio.ini
- name: Compile firmware
uses: ./.github/workflows/firmware-compile
with:
project-env: firmware_esp32s3
- name: Copy bin to upload
run: |
cp -f ${{ github.workspace }}/firmware/.pio/build/firmware_esp32s3/firmware.bin ${{ github.workspace }}/JAAM_S3_${{ inputs.release-version }}.bin
- name: Upload firmware
uses: actions/upload-artifact@v4
with:
name: JAAM_S3_${{ inputs.release-version }}.bin
path: ${{ github.workspace }}/JAAM_S3_${{ inputs.release-version }}.bin
build_c3:
if: ${{ github.ref_name == 'master' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Replace version in firmware source
run: |
sed -i 's/VERSION=".*"/VERSION="${{ inputs.release-version }}"/' ${{ github.workspace }}/firmware/platformio.ini
- name: Compile firmware
uses: ./.github/workflows/firmware-compile
with:
project-env: firmware_esp32c3
- name: Copy bin to upload
run: |
cp -f ${{ github.workspace }}/firmware/.pio/build/firmware_esp32c3/firmware.bin ${{ github.workspace }}/JAAM_C3_${{ inputs.release-version }}.bin
- name: Upload firmware
uses: actions/upload-artifact@v4
with:
name: JAAM_C3_${{ inputs.release-version }}.bin
path: ${{ github.workspace }}/JAAM_C3_${{ inputs.release-version }}.bin
build_lite:
if: ${{ github.ref_name == 'master' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Replace version and build type in firmware source
- name: Replace version in firmware source
run: |
sed -i 's/VERSION = ".*";/VERSION = "${{ inputs.release-version }}";/' ${{ github.workspace }}/firmware/src/JaamFirmware.cpp
sed -i 's/#define LITE ./#define LITE 1/' ${{ github.workspace }}/firmware/src/Definitions.h
sed -i 's/VERSION=".*"/VERSION="${{ inputs.release-version }}"/' ${{ github.workspace }}/firmware/platformio.ini
- name: Compile firmware
uses: ./.github/workflows/firmware-compile
with:
project-env: firmware_lite
- name: Copy bin to upload
run: |
cp -f ${{ github.workspace }}/firmware/.pio/build/firmware/firmware.bin ${{ github.workspace }}/JAAM_${{ inputs.release-version }}_lite.bin
cp -f ${{ github.workspace }}/firmware/.pio/build/firmware_lite/firmware.bin ${{ github.workspace }}/JAAM_${{ inputs.release-version }}_lite.bin
- name: Upload firmware
uses: actions/upload-artifact@v4
with:
name: JAAM_${{ inputs.release-version }}_lite.bin
path: ${{ github.workspace }}/JAAM_${{ inputs.release-version }}_lite.bin
release_firmware:
needs: [build, build_lite]
needs: [build, build_s3, build_c3, build_lite]
runs-on: ubuntu-latest
environment:
name: github-pages
Expand All @@ -65,12 +108,22 @@ jobs:
uses: actions/checkout@v4
- name: Replace version in firmware source
run: |
sed -i 's/VERSION = ".*";/VERSION = "${{ inputs.release-version }}";/' ${{ github.workspace }}/firmware/src/JaamFirmware.cpp
sed -i 's/VERSION=".*"/VERSION="${{ inputs.release-version }}"/' ${{ github.workspace }}/firmware/platformio.ini
- name: Download firmware
uses: actions/download-artifact@v4
with:
name: JAAM_${{ inputs.release-version }}.bin
path: ${{ github.workspace }}/JAAM_${{ inputs.release-version }}.bin
- name: Download S3 firmware
uses: actions/download-artifact@v4
with:
name: JAAM_S3_${{ inputs.release-version }}.bin
path: ${{ github.workspace }}/JAAM_S3_${{ inputs.release-version }}.bin
- name: Download C3 firmware
uses: actions/download-artifact@v4
with:
name: JAAM_C3_${{ inputs.release-version }}.bin
path: ${{ github.workspace }}/JAAM_C3_${{ inputs.release-version }}.bin
- name: Download firmware lite
uses: actions/download-artifact@v4
with:
Expand All @@ -80,12 +133,24 @@ jobs:
run: |
mkdir -p ${{ github.workspace }}/bin/
mkdir -p ${{ github.workspace }}/bin_beta/
mkdir -p ${{ github.workspace }}/bin/s3/
mkdir -p ${{ github.workspace }}/bin_beta/s3/
mkdir -p ${{ github.workspace }}/bin/c3/
mkdir -p ${{ github.workspace }}/bin_beta/c3/
cp -f ${{ github.workspace }}/JAAM_${{ inputs.release-version }}.bin/JAAM_${{ inputs.release-version }}.bin ${{ github.workspace }}/bin/${{ inputs.release-version }}.bin
cp -f ${{ github.workspace }}/JAAM_${{ inputs.release-version }}.bin/JAAM_${{ inputs.release-version }}.bin ${{ github.workspace }}/bin_beta/${{ inputs.release-version }}.bin
cp -f ${{ github.workspace }}/JAAM_S3_${{ inputs.release-version }}.bin/JAAM_S3_${{ inputs.release-version }}.bin ${{ github.workspace }}/bin/s3/${{ inputs.release-version }}.bin
cp -f ${{ github.workspace }}/JAAM_S3_${{ inputs.release-version }}.bin/JAAM_S3_${{ inputs.release-version }}.bin ${{ github.workspace }}/bin_beta/s3/${{ inputs.release-version }}.bin
cp -f ${{ github.workspace }}/JAAM_C3_${{ inputs.release-version }}.bin/JAAM_C3_${{ inputs.release-version }}.bin ${{ github.workspace }}/bin/c3/${{ inputs.release-version }}.bin
cp -f ${{ github.workspace }}/JAAM_C3_${{ inputs.release-version }}.bin/JAAM_C3_${{ inputs.release-version }}.bin ${{ github.workspace }}/bin_beta/c3/${{ inputs.release-version }}.bin
- name: Leave only 5 recent PROD builds and 10 recent BETA builds
run: |
bash ${{ github.workspace }}/deploy/remove_old_bins.sh ${{ github.workspace }}/bin/ 5
bash ${{ github.workspace }}/deploy/remove_old_bins.sh ${{ github.workspace }}/bin_beta/ 10
bash ${{ github.workspace }}/deploy/remove_old_bins.sh ${{ github.workspace }}/bin/s3/ 5
bash ${{ github.workspace }}/deploy/remove_old_bins.sh ${{ github.workspace }}/bin_beta/s3/ 10
bash ${{ github.workspace }}/deploy/remove_old_bins.sh ${{ github.workspace }}/bin/c3/ 5
bash ${{ github.workspace }}/deploy/remove_old_bins.sh ${{ github.workspace }}/bin_beta/c3/ 10
- name: Upload flasher to Github Pages
uses: ./.github/workflows/upload-pages
with:
Expand All @@ -97,7 +162,7 @@ jobs:
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Release ${{ inputs.release-version }}"
file_pattern: ${{ github.workspace }}/firmware/src/JaamFirmware.cpp ${{ github.workspace }}/bin/ ${{ github.workspace }}/bin_beta/ ${{ github.workspace }}/flasher/
file_pattern: ${{ github.workspace }}/firmware/platformio.ini ${{ github.workspace }}/bin/ ${{ github.workspace }}/bin_beta/ ${{ github.workspace }}/flasher/
- name: Create Release
uses: ncipollo/release-action@v1
with:
Expand Down
Loading

0 comments on commit 76b1639

Please sign in to comment.