Skip to content

Commit

Permalink
Merge pull request #168 from v00g100skr/develop
Browse files Browse the repository at this point in the history
3.8
  • Loading branch information
v00g100skr authored Mar 18, 2024
2 parents b9a866e + 0427dee commit 167be06
Show file tree
Hide file tree
Showing 46 changed files with 3,013 additions and 1,957 deletions.
15 changes: 13 additions & 2 deletions .github/workflows/beta_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,12 @@ jobs:
release_beta_firmware:
if: ${{ github.ref_name == 'develop' }}
runs-on: ubuntu-latest
environment:
name: github-pages
permissions:
contents: write
pages: write
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -29,21 +33,28 @@ jobs:
mkdir -p ${{ github.workspace }}/bin_beta/
cp -f ${{ github.workspace }}/src/firmware/build/esp32.esp32.esp32/firmware.ino.bin ${{ github.workspace }}/bin_beta/${{ env.BETA_VERSION }}.bin
cp -f ${{ github.workspace }}/src/firmware/build/esp32.esp32.esp32/firmware.ino.bin ${{ github.workspace }}/bin_beta/latest_beta.bin
cp -f ${{ github.workspace }}/src/firmware/build/esp32.esp32.esp32/firmware.ino.bin ${{ github.workspace }}/JAAM_${{ env.BETA_VERSION }}.bin
- name: Leave only 3 recent BETA builds
run: |
cd ${{ github.workspace }}/bin_beta/
ls -tp | grep -v '/$' | tail -n +5 | xargs -I {} rm -- {}
cd ${{ github.workspace }}
- name: Upload flasher to Github Pages
uses: ./.github/workflows/upload-pages
with:
beta_binary_path: ${{ github.workspace }}/JAAM_${{ 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 }}/bin_beta/
file_pattern: ${{ github.workspace }}/bin_beta/ ${{ github.workspace }}/pages/
- name: Create Beta Pre Release
uses: ncipollo/release-action@v1
with:
artifacts: ${{ github.workspace }}/bin_beta/${{ env.BETA_VERSION }}.bin
artifacts: ${{ github.workspace }}/JAAM_${{ env.BETA_VERSION }}.bin
name: ${{ env.RELEASE_TITLE }}
commit: ${{ steps.commit_changes.outputs.commit_hash }}
tag: ${{ env.BETA_VERSION }}
Expand Down
46 changes: 33 additions & 13 deletions .github/workflows/compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,32 +21,36 @@
with:
enable-warnings-report: true
sketches-report-path: ${{ env.SKETCHES_REPORTS_PATH }}
- name: Copy bin file
run: |
cp -f ${{ github.workspace }}/src/firmware/build/esp32.esp32.esp32/firmware.ino.bin ${{ github.workspace }}/firmware.bin
- name: Upload firmware
uses: actions/upload-artifact@v4
with:
name: firmware.bin
path: ${{ github.workspace }}/src/firmware/build/esp32.esp32.esp32/firmware.ino.bin
path: ${{ github.workspace }}/firmware.bin
- name: Upload reports
uses: actions/upload-artifact@v4
with:
name: ${{ env.SKETCHES_REPORTS_ARTIFACT_NAME }}
path: ${{ env.SKETCHES_REPORTS_PATH }}
lint_check:
compile_firmware_lite:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Lint check
uses: arduino/arduino-lint-action@v1
with:
path: ${{ github.workspace }}/src/firmware
verbose: true
compliance: specification
report-file: ${{ github.workspace }}/lint-report.json
- name: Upload lint report
- name: Switch to LITE version
run: |
sed -i 's/#define LITE ./#define LITE 1/' ${{ github.workspace }}/src/firmware/firmware.ino
- name: Compile firmware
uses: ./.github/workflows/firmware-compile
- name: Copy bin file
run: |
cp -f ${{ github.workspace }}/src/firmware/build/esp32.esp32.esp32/firmware.ino.bin ${{ github.workspace }}/firmware-lite.bin
- name: Upload firmware lite
uses: actions/upload-artifact@v4
with:
name: lint-report
path: ${{ github.workspace }}/lint-report.json
name: firmware-lite.bin
path: ${{ github.workspace }}/firmware-lite.bin
compile_updater:
runs-on: ubuntu-latest
steps:
Expand All @@ -64,4 +68,20 @@
uses: actions/upload-artifact@v4
with:
name: updater.bin
path: ${{ github.workspace }}/src/updater/build/esp32.esp32.esp32/updater.ino.bin
path: ${{ github.workspace }}/src/updater/build/esp32.esp32.esp32/updater.ino.bin
lint_check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Lint check
uses: arduino/arduino-lint-action@v1
with:
path: ${{ github.workspace }}/src/firmware
verbose: true
compliance: specification
report-file: ${{ github.workspace }}/lint-report.json
- name: Upload lint report
uses: actions/upload-artifact@v4
with:
name: lint-report
path: ${{ github.workspace }}/lint-report.json
17 changes: 17 additions & 0 deletions .github/workflows/deploy_flasher.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: ⚡ Deploy Flasher
on: workflow_dispatch
jobs:
deploy_flasher:
runs-on: ubuntu-latest
environment:
name: github-pages
permissions:
contents: write
pages: write
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Upload flasher to Github Pages
uses: ./.github/workflows/upload-pages

42 changes: 21 additions & 21 deletions .github/workflows/firmware-compile/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,32 +31,32 @@ runs:
libraries: |
- source-path: ${{ github.workspace }}/libs/Adafruit_GFX_Library
- source-path: ${{ github.workspace }}/libs/ArduinoAsync-master
- name: ESP Async WebServer
version: 2.7.0
- name: Adafruit SSD1306
version: 2.5.9
- name: home-assistant-integration
version: 2.1.0
- name: NeoPixelBus by Makuna
version: 2.7.8
- name: NTPTime
version: 1.2.1
- name: WiFiManager
version: 2.0.16-rc.2
- name: AsyncTCP
version: 1.1.4
- name: ArduinoJson
version: 7.0.3
version: 7.0.4
- name: ArduinoWebsockets
version: 0.5.3
- name: BME280
version: 3.0.0
- name: SHT2x
version: 0.5.0
- name: SHT31
version: 0.5.0
- name: BH1750
version: 1.3.0
- name: AsyncTCP
version: 1.1.4
- name: BH1750_WE
version: 1.1.10
- name: ESP Async WebServer
version: 2.8.1
- name: Melody Player
version: 2.4.0
- name: NTPTime
version: 1.2.1
- name: NeoPixelBus by Makuna
version: 2.7.8
- name: WiFiManager
version: 2.0.17
- name: arduino-sht
version: 1.2.5
- name: forcedBMX280
version: 1.1.2
- name: home-assistant-integration
version: 2.1.0
enable-warnings-report: ${{ inputs.enable-warnings-report }}
enable-deltas-report: ${{ inputs.enable-deltas-report }}
sketches-report-path: ${{ inputs.sketches-report-path }}
Expand Down
75 changes: 66 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,9 @@ on:
type: string
run-name: Release ${{ inputs.release-version }} (${{ inputs.release-title }})
jobs:
release_firmware:
build:
if: ${{ github.ref_name == 'master' }}
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -25,31 +23,90 @@ jobs:
sed -i 's/VERSION = ".*";/VERSION = "${{ inputs.release-version }}";/' ${{ github.workspace }}/src/firmware/firmware.ino
- name: Compile firmware
uses: ./.github/workflows/firmware-compile
- name: Copy bin to upload
run: |
cp -f ${{ github.workspace }}/src/firmware/build/esp32.esp32.esp32/firmware.ino.bin ${{ github.workspace }}/JAAM_${{ inputs.release-version }}.bin
- name: Upload firmware
uses: actions/upload-artifact@v4
with:
name: JAAM_${{ inputs.release-version }}.bin
path: ${{ github.workspace }}/JAAM_${{ 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
run: |
sed -i 's/VERSION = ".*";/VERSION = "${{ inputs.release-version }}";/' ${{ github.workspace }}/src/firmware/firmware.ino
sed -i 's/#define LITE ./#define LITE 1/' ${{ github.workspace }}/src/firmware/firmware.ino
- name: Compile firmware
uses: ./.github/workflows/firmware-compile
- name: Copy bin to upload
run: |
cp -f ${{ github.workspace }}/src/firmware/build/esp32.esp32.esp32/firmware.ino.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]
runs-on: ubuntu-latest
environment:
name: github-pages
permissions:
contents: write
pages: write
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Replace version in firmware source
run: |
sed -i 's/VERSION = ".*";/VERSION = "${{ inputs.release-version }}";/' ${{ github.workspace }}/src/firmware/firmware.ino
- 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 firmware lite
uses: actions/download-artifact@v4
with:
name: JAAM_${{ inputs.release-version }}_lite.bin
path: ${{ github.workspace }}/JAAM_${{ inputs.release-version }}_lite.bin
- name: Copy release files to bin folder
run: |
mkdir -p ${{ github.workspace }}/bin/
mkdir -p ${{ github.workspace }}/bin_beta/
cp -f ${{ github.workspace }}/src/firmware/build/esp32.esp32.esp32/firmware.ino.bin ${{ github.workspace }}/bin/${{ inputs.release-version }}.bin
cp -f ${{ github.workspace }}/src/firmware/build/esp32.esp32.esp32/firmware.ino.bin ${{ github.workspace }}/bin/latest.bin
cp -f ${{ github.workspace }}/src/firmware/build/esp32.esp32.esp32/firmware.ino.bin ${{ github.workspace }}/bin_beta/${{ inputs.release-version }}.bin
cp -f ${{ github.workspace }}/src/firmware/build/esp32.esp32.esp32/firmware.ino.bin ${{ github.workspace }}/bin_beta/latest_beta.bin
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/latest.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_${{ inputs.release-version }}.bin/JAAM_${{ inputs.release-version }}.bin ${{ github.workspace }}/bin_beta/latest_beta.bin
- name: Leave only 3 recent releases
run: |
cd ${{ github.workspace }}/bin/
ls -tp | grep -v '/$' | tail -n +5 | xargs -I {} rm -- {}
cd ${{ github.workspace }}/bin_beta/
ls -tp | grep -v '/$' | tail -n +5 | xargs -I {} rm -- {}
cd ${{ github.workspace }}
- name: Upload flasher to Github Pages
uses: ./.github/workflows/upload-pages
with:
binary_path: ${{ github.workspace }}/JAAM_${{ inputs.release-version }}.bin/JAAM_${{ inputs.release-version }}.bin
lite_binary_path: ${{ github.workspace }}/JAAM_${{ inputs.release-version }}_lite.bin/JAAM_${{ inputs.release-version }}_lite.bin
version: ${{ inputs.release-version }}
- name: Commit changes
id: commit_changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Release ${{ inputs.release-version }}"
file_pattern: ${{ github.workspace }}/src/firmware/firmware.ino ${{ github.workspace }}/bin/ ${{ github.workspace }}/bin_beta/
file_pattern: ${{ github.workspace }}/src/firmware/firmware.ino ${{ github.workspace }}/bin/ ${{ github.workspace }}/bin_beta/ ${{ github.workspace }}/pages/
- name: Create Release
uses: ncipollo/release-action@v1
with:
artifacts: ${{ github.workspace }}/bin/${{ inputs.release-version }}.bin
artifacts: "${{ github.workspace }}/JAAM_${{ inputs.release-version }}.bin/JAAM_${{ inputs.release-version }}.bin,${{ github.workspace }}/JAAM_${{ inputs.release-version }}_lite.bin/JAAM_${{ inputs.release-version }}_lite.bin"
name: "${{ inputs.release-version }}: ${{ inputs.release-title }}"
commit: ${{ steps.commit_changes.outputs.commit_hash }}
tag: ${{ inputs.release-version }}
Expand Down
63 changes: 63 additions & 0 deletions .github/workflows/upload-pages/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: 'Upload Flasher to Github Pages'
description: 'Upload Flasher to Github Pages'
inputs:
binary_path:
description: 'Path to the binary'
default: ''
beta_binary_path:
description: 'Path to the beta binary'
default: ''
lite_binary_path:
description: 'Path to the lite binary'
default: ''
version:
description: 'Version of the binary'
default: ''
beta_build:
description: 'Beta build number'
default: ''
runs:
using: 'composite'
steps:
- name: Copy bin to flesher
if: ${{ inputs.binary_path != '' }}
shell: bash
run: |
cp -f ${{ inputs.binary_path }} ${{ github.workspace }}/pages/bins/jaam.bin
- name: Change version in flasher
if: ${{ inputs.binary_path != '' }}
shell: bash
run: |
sed -i 's/>Встановити JAAM [0-9.]*</>Встановити JAAM ${{ inputs.version }}</' ${{ github.workspace }}/pages/index.html
sed -i 's/"version": ".*",/"version": "${{ inputs.version }}",/' ${{ github.workspace }}/pages/manifest.json
- name: Copy beta bin to flasher
if: ${{ inputs.beta_binary_path != '' }}
shell: bash
run: |
cp -f ${{ inputs.beta_binary_path }} ${{ github.workspace }}/pages/bins/jaam_beta.bin
- name: Change beta version in flasher
if: ${{ inputs.beta_binary_path != '' }}
shell: bash
run: |
sed -i 's/>Встановити JAAM [0-9.]* Beta [0-9]*</>Встановити JAAM ${{ inputs.version }} Beta ${{ inputs.beta_build }}</' ${{ github.workspace }}/pages/index.html
sed -i 's/"version": ".*",/"version": "${{ inputs.version }}-b${{ inputs.beta_build }}",/' ${{ github.workspace }}/pages/manifest-beta.json
- name: Copy lite bin to flasher
if: ${{ inputs.lite_binary_path != '' }}
shell: bash
run: |
cp -f ${{ inputs.lite_binary_path }} ${{ github.workspace }}/pages/bins/jaam_lite.bin
- name: Change lite version in flasher
if: ${{ inputs.lite_binary_path != '' }}
shell: bash
run: |
sed -i 's/>Встановити JAAM [0-9.]* Lite</>Встановити JAAM ${{ inputs.version }} Lite</' ${{ github.workspace }}/pages/index.html
sed -i 's/"version": ".*",/"version": "${{ inputs.version }}",/' ${{ github.workspace }}/pages/manifest-lite.json
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: '${{ github.workspace }}/pages'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
/deploy/weather_map.png
/deploy/shared_data/
.DS_Store
.idea/
.idea/
.vscode/
Loading

0 comments on commit 167be06

Please sign in to comment.