-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into new_shield_old_dac_adc
- Loading branch information
Showing
1 changed file
with
81 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
name: PlatformIO Build and Release | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build-and-release: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
# Checkout repository | ||
- uses: actions/checkout@v3 | ||
|
||
# Cache dependencies | ||
- uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.cache/pip | ||
~/.platformio/.cache | ||
key: ${{ runner.os }}-pio | ||
|
||
# Setup Python environment | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.11' | ||
|
||
# Install PlatformIO Core | ||
- name: Install PlatformIO Core | ||
run: pip install --upgrade platformio | ||
|
||
# Build PlatformIO Project for M4 and M7 | ||
- name: Build M4 and M7 Firmware | ||
run: | | ||
cd ./m4 && pio run && cd ../m7 && pio run | ||
# Rename firmware files | ||
- name: Rename Firmware Files | ||
run: | | ||
mkdir -p firmware | ||
mv ./m4/.pio/build/*/firmware.bin ./firmware/firmwareM4.bin | ||
mv ./m7/.pio/build/*/firmware.bin ./firmware/firmwareM7.bin | ||
# Clone the firmware uploader repository | ||
- name: Clone Firmware Uploader Repo | ||
run: | | ||
git clone https://github.com/afylab/firmware_uploader.git | ||
cd firmware_uploader | ||
rm -f firmware/firmwareM4.bin firmware/firmwareM7.bin | ||
cp ../firmware/firmwareM4.bin firmware/ | ||
cp ../firmware/firmwareM7.bin firmware/ | ||
rm -rf .git | ||
# Create a zip archive | ||
- name: Create Zip Archive | ||
run: | | ||
zip -r Firmware_Package.zip firmware_uploader | ||
# Create GitHub Release | ||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: v${{ github.run_number }} | ||
release_name: Firmware Uploader Package v${{ github.run_number }} | ||
body: | | ||
This release includes the updated firmware files and firmware uploader package. | ||
draft: true | ||
prerelease: false | ||
|
||
# Upload release asset | ||
- name: Upload Release Asset | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: Firmware_Package.zip | ||
asset_name: Firmware_Package.zip | ||
asset_content_type: application/zip |