FujiNet Nightly Builds #22
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
name: "FujiNet Nightly Builds" | |
on: | |
schedule: | |
- cron: '0 4 * * *' | |
workflow_dispatch: | |
jobs: | |
nightly-release: | |
name: "PlatformIO CI" | |
runs-on: "ubuntu-latest" | |
strategy: | |
matrix: | |
target-platform: [ATARI, ADAM, APPLE, IEC-LOLIN-D32, COCO] | |
steps: | |
- name: Checkout Source | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Cache pip | |
uses: actions/cache@v2 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: Cache PlatformIO | |
uses: actions/cache@v2 | |
with: | |
path: ~/.platformio | |
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }} | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.12.1' | |
- name: Install PlatformIO | |
run: | | |
python -m pip install --upgrade pip | |
pip install setuptools | |
pip install --upgrade platformio | |
pip install Jinja2 | |
pip install pyyaml | |
- name: Show python version | |
run: python --version | |
- name: Show pio system info | |
run: pio system info | |
- name: Show pio location | |
run: pip show platformio | |
- name: Create PlatformIO INI for Build | |
run: cd /home/runner/work/fujinet-firmware/fujinet-firmware && /usr/bin/bash ./build.sh -l /home/runner/work/fujinet-firmware/fujinet-firmware/.github/workflows/platformio.release-${{ matrix.target-platform }}.ini -i /home/runner/work/fujinet-firmware/fujinet-firmware/platformio-generated.ini | |
- name: Show platformio.ini | |
run: cat /home/runner/work/fujinet-firmware/fujinet-firmware/platformio-generated.ini | |
- uses: benjlevesque/[email protected] | |
id: short-sha | |
with: | |
length: 6 | |
- name: Get Old Version | |
id: version | |
run: echo "VERSION=$(grep '#define FN_VERSION_FULL' /home/runner/work/fujinet-firmware/fujinet-firmware/include/version.h | sed 's/^.*"\(.*\)".*$/\1/')" >> $GITHUB_OUTPUT | |
- name: Get Commit Date | |
id: commit-date | |
run: echo "COMMIT_DATE=$(git --no-pager log -1 --pretty='format:%cd' --date='format:%Y-%m-%d %H:%M:%S')">> $GITHUB_OUTPUT | |
- name: Set Nightly Version in Firmware | |
id: nightly-version | |
run: sed -i "s/\"${{ steps.version.outputs.VERSION }}\"/\"${{ steps.version.outputs.VERSION }}.${{ steps.short-sha.outputs.sha }}\"/" /home/runner/work/fujinet-firmware/fujinet-firmware/include/version.h | |
- name: Set Version Date in Firmware | |
id: nightly-date | |
run: sed -i 's/#define FN_VERSION_DATE "[^"]*"/#define FN_VERSION_DATE "${{ steps.commit-date.outputs.COMMIT_DATE }}"/' /home/runner/work/fujinet-firmware/fujinet-firmware/include/version.h | |
- name: Build release | |
run: cd /home/runner/work/fujinet-firmware/fujinet-firmware && /usr/bin/bash ./build.sh -z -l /home/runner/work/fujinet-firmware/fujinet-firmware/.github/workflows/platformio.release-${{ matrix.target-platform }}.ini -i /home/runner/work/fujinet-firmware/fujinet-firmware/platformio-generated.ini | |
- name: Standardize Firmware Name | |
run: mv ./firmware/fujinet*.zip ./firmware/nightly-fujinet-${{ matrix.target-platform }}-${{ steps.version.outputs.VERSION }}.${{ steps.short-sha.outputs.sha }}.zip | |
- name: Deploy ${{ matrix.target-platform }} Firmware | |
uses: WebFreak001/[email protected] | |
with: | |
upload_url: https://uploads.github.com/repos/FujiNetWIFI/fujinet-firmware/releases/156608864/assets{?name,label} | |
release_id: 156608864 | |
asset_path: ./firmware/nightly-fujinet-${{ matrix.target-platform }}-${{ steps.version.outputs.VERSION }}.${{ steps.short-sha.outputs.sha }}.zip | |
asset_name: fujinet-${{ matrix.target-platform }}-${{ steps.version.outputs.VERSION }}-${{ steps.short-sha.outputs.sha }}.zip | |
asset_content_type: application/zip | |
max_releases: 1 |