Check upstream releases #12
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: Check upstream releases | |
on: | |
schedule: | |
- cron: '0 0 * * *' # Nightly | |
workflow_dispatch: # Debugging | |
jobs: | |
check: | |
name: Check for meshtastic firmware changes | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v4 | |
# Get the latest meshtastic releases | |
- id: gh_meshtastic_firmware_release | |
name: Get latest Meshtastic firmware releases | |
run: | | |
beta_json=$(curl -s ${{ github.api_url }}/repos/meshtastic/firmware/releases/latest | jq) | |
alpha_json=$(curl -s ${{ github.api_url }}/repos/meshtastic/firmware/releases | jq 'map(select(.prerelease)) | first') | |
echo "beta_ver=$(jq -r '.tag_name' <<< $beta_json)" >> $GITHUB_OUTPUT | |
echo "alpha_ver=$(jq -r '.tag_name' <<< $alpha_json)" >> $GITHUB_OUTPUT | |
# Get the latest ${{ github.repository }} releases | |
- id: gh_currentrepo_release | |
name: Get latest release of this repo | |
run: | | |
beta_json=$(curl -s ${{ github.api_url }}/repos/${{ github.repository }}/releases/latest | jq) | |
alpha_json=$(curl -s ${{ github.api_url }}/repos/${{ github.repository }}/releases | jq 'map(select(.prerelease)) | first') | |
echo "beta_ver=$(jq -r '.tag_name' <<< $beta_json)" >> $GITHUB_OUTPUT | |
echo "alpha_ver=$(jq -r '.tag_name' <<< $alpha_json)" >> $GITHUB_OUTPUT | |
continue-on-error: true | |
outputs: | |
meshtastic_alpha_ver: ${{ steps.gh_meshtastic_firmware_release.outputs.alpha_ver }} | |
meshtastic_beta_ver: ${{ steps.gh_meshtastic_firmware_release.outputs.beta_ver }} | |
currentrepo_alpha_ver: ${{ steps.gh_currentrepo_release.outputs.alpha_ver }} | |
currentrepo_beta_ver: ${{ steps.gh_currentrepo_release.outputs.beta_ver }} | |
build_alpha: | |
needs: check | |
if: needs.check.outputs.currentrepo_alpha_ver != needs.check.outputs.meshtastic_alpha_ver | |
name: Build firmware (Alpha) | |
uses: ./.github/workflows/build.yml | |
with: | |
meshtastic_firmware_ref: ${{ needs.check.outputs.meshtastic_alpha_ver }} | |
build_beta: | |
needs: check | |
if: needs.check.outputs.currentrepo_beta_ver != needs.check.outputs.meshtastic_beta_ver | |
name: Build firmware (Beta) | |
uses: ./.github/workflows/build.yml | |
with: | |
meshtastic_firmware_ref: ${{ needs.check.outputs.meshtastic_beta_ver }} |