Skip to content

Check upstream releases #42

Check upstream releases

Check upstream releases #42

name: Check upstream releases
on:
schedule:
- cron: '0 0 * * *' # Nightly
workflow_dispatch: # Debugging
jobs:
check:
name: Check Upstream
strategy:
matrix:
channel: [alpha, beta]
runs-on: ubuntu-24.04
steps:
- id: fw_release
name: Get latest firmware release
run: |
if [ "${{ matrix.channel }}" == "alpha" ]; then
meshtastic_json=$(curl -s ${{ github.api_url }}/repos/meshtastic/firmware/releases | jq 'map(select(.prerelease)) | first')
currentrepo_json=$(curl -s ${{ github.api_url }}/repos/${{ github.repository }}/releases | jq 'map(select(.prerelease)) | first')
elif [ "${{ matrix.channel }}" == "beta" ]; then
meshtastic_json=$(curl -s ${{ github.api_url }}/repos/meshtastic/firmware/releases/latest | jq)
currentrepo_json=$(curl -s ${{ github.api_url }}/repos/${{ github.repository }}/releases/latest | jq)
fi
echo "meshtastic_ver=$(jq -r '.tag_name' <<< $meshtastic_json)" >> $GITHUB_OUTPUT
echo "currentrepo_ver=$(jq -r '.tag_name' <<< $currentrepo_json)" >> $GITHUB_OUTPUT
continue-on-error: true
outputs:
meshtastic_ver: ${{ steps.fw_release.outputs.meshtastic_ver }}
currentrepo_ver: ${{ steps.fw_release.outputs.currentrepo_ver }}
build:
# name: Build
needs: check
if: needs.check.outputs.currentrepo_ver != needs.check.outputs.meshtastic_ver
uses: ./.github/workflows/build.yml
with:
meshtastic_firmware_ref: ${{ needs.check.outputs.meshtastic_ver }}
create_release: true