update workflow #10
This file contains hidden or 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
| name: Nightly Arduino Build | |
| on: | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| branches: | |
| - master | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install Arduino CLI | |
| run: | | |
| curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | sh | |
| sudo mv bin/arduino-cli /usr/local/bin/ | |
| - name: Set up Arduino CLI | |
| run: | | |
| arduino-cli config init | |
| arduino-cli core update-index | |
| arduino-cli core install arduino:avr | |
| - name: Install Adafruit GFX Library (via Library Manager) | |
| run: | | |
| arduino-cli lib install "Adafruit GFX Library" | |
| arduino-cli lib install "SD" | |
| - name: Clone SH1106, TinyGPSPlus, and Base64 libraries | |
| run: | | |
| mkdir -p custom-libraries | |
| git clone https://github.com/wonho-maker/Adafruit_SH1106 custom-libraries/Adafruit_SH1106 | |
| git clone https://github.com/mikalhart/TinyGPSPlus custom-libraries/TinyGPSPlus | |
| git clone https://github.com/Xander-Electronics/Base64 custom-libraries/Base64 | |
| - name: Compile sketch for Arduino Mega 2560 | |
| run: | | |
| mkdir -p build-out | |
| arduino-cli compile \ | |
| --fqbn arduino:avr:mega \ | |
| --libraries custom-libraries \ | |
| --output-dir build-out \ | |
| Source/HamMessenger | |
| #- name: List everything in build output | |
| # run: | | |
| # find Source/HamMessenger/build-out | |
| - name: List all .hex files | |
| run: | | |
| find . -name "*.hex" | |
| - name: Rename firmware file for release | |
| run: | | |
| mkdir -p output | |
| cp build-out/HamMessenger.ino.hex output/HamMessenger-mega2560.hex | |
| - name: Generate changelog from recent commits | |
| run: | | |
| git log -n 20 --pretty=format:"- %s" > release-notes.txt | |
| # git log $(git describe --tags --abbrev=0)..HEAD --pretty=format:"- %s" # changelog between the last nightly and now | |
| # git log -n 20 --pretty=format:"- %s (%an, %ad)" --date=short # include author names or dates | |
| - name: Upload nightly firmware to release | |
| uses: ncipollo/release-action@v1 | |
| with: | |
| tag: nightly | |
| name: Nightly Build | |
| prerelease: true | |
| draft: true | |
| allowUpdates: true | |
| artifacts: output/HamMessenger-mega2560.hex | |
| bodyFile: release-notes.txt | |
| gui-build: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.10' | |
| - name: Install Python dependencies | |
| run: | | |
| pip install -r Source/GUI/requirements.txt | |
| pip install pyinstaller | |
| - name: Build GUI with PyInstaller | |
| run: | | |
| cd Source/GUI | |
| pyinstaller --noconfirm --windowed --name HamMessenger --onefile Main.py | |
| - name: Copy built GUI executable | |
| run: | | |
| mkdir output | |
| copy Source\GUI\dist\HamMessenger.exe output\HamMessenger-GUI.exe | |
| - name: Upload GUI to nightly release | |
| uses: ncipollo/release-action@v1 | |
| with: | |
| tag: nightly | |
| name: Nightly Build | |
| prerelease: true | |
| draft: true | |
| allowUpdates: true | |
| artifacts: output/HamMessenger-GUI.exe |