Skip to content

chore: include bootloader in release images #197

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 4, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 31 additions & 2 deletions .github/workflows/main-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
ref: ${{ matrix.branch }}
path: ${{ matrix.branch }}

- name: Cache XC-16 Compiler
- name: Cache Compilers
id: cache-compiler
uses: actions/cache@v3
with:
Expand Down Expand Up @@ -64,9 +64,38 @@ jobs:
cd build_${{ matrix.target }}
cmake .. ${{ matrix.cmake_flags}}
make

- name: Fetch bootloader
run: |
git clone https://github.com/fossasia/pslab-bootloader.git pslab-bootloader
cd pslab-bootloader
mkdir build
cd build
wget https://github.com/fossasia/pslab-bootloader/releases/latest/download/pslab-bootloader.hex

- name: Download XC8 Compiler
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚨 suggestion (security): Consider verifying the downloaded installer

A checksum verification or similar integrity check after downloading the installer could help ensure that the file is not corrupted or tampered with.

Suggested implementation:

          - name: Download XC8 Compiler
            if: steps.cache-compiler.outputs.cache-hit != 'true'
            run: |
              # Download XC8 Compiler installer
              wget https://example.com/path/to/xc8_installer.run -O xc8_installer.run
              # Verify installer checksum to ensure integrity
              expected_checksum="abc123def456ghi789jkl012mno345pq"  # Replace with the actual expected checksum value
              actual_checksum=$(sha256sum xc8_installer.run | awk '{print $1}')
              if [ "$actual_checksum" != "$expected_checksum" ]; then
                echo "Checksum verification failed! Expected: $expected_checksum, Got: $actual_checksum."
                exit 1
              fi

              # Continue with installation or further steps

Please update the download URL (https://example.com/path/to/xc8_installer.run) and expected_checksum with the actual values as required by your project.

if: steps.cache-compiler.outputs.cache-hit != 'true'
run: |
mkdir -p ~/.cache/mplab-xc
cd ~/.cache/mplab-xc
wget https://ww1.microchip.com/downloads/aemDocuments/documents/DEV/ProductDocuments/SoftwareTools/xc8-v3.00-full-install-linux-x64-installer.run
chmod +x xc8-v3.00-full-install-linux-x64-installer.run

- name: Install XC8 Compiler
run: |
cd ~/.cache/mplab-xc
sudo ./xc8-v3.00-full-install-linux-x64-installer.run --mode unattended --netservername dontknow
echo "/opt/microchip/xc8/v3.00/pic/bin" >> $GITHUB_PATH

- name: Combine hex files
run: |
mv ${{ matrix.branch }}/build_${{ matrix.target }}/pslab-firmware.hex pslab-bootloader/build/pslab-firmware.hex
cd pslab-bootloader
chmod +x combine_hex.sh
./combine_hex.sh

- name: Publish build files
uses: actions/upload-artifact@v4
with:
name: pslab-firmware_${{ matrix.target}}
path: ${{ matrix.branch }}/build_${{ matrix.target }}/pslab-firmware.hex
path: pslab-bootloader/build/combined.hex