Skip to content

Version Check

Version Check #487

Workflow file for this run

name: Version Check
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
jobs:
update-media-mtx:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Get Latest MediaMTX Release
id: media_mtx
run: |
release_tag=$(curl -s https://api.github.com/repos/bluenviron/mediamtx/releases/latest | jq -r '.tag_name' | sed 's/^v//')
if [[ ! $release_tag =~ ^[0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?$ ]]; then
echo "Invalid version format: ${release_tag}. Exiting workflow."
exit 1
fi
current_tag=$(cat ./app/.env | grep MTX_TAG | cut -d'=' -f2)
sed -i "s/MTX_TAG=.*/MTX_TAG=${release_tag}/" ./app/.env
echo "release_tag=$release_tag" >> $GITHUB_OUTPUT
echo "current_tag=$current_tag" >> $GITHUB_OUTPUT
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
if: steps.media_mtx.outputs.current_tag != '' && steps.media_mtx.outputs.current_tag != steps.media_mtx.outputs.release_tag
with:
title: 'Bump MediaMTX to v${{ steps.media_mtx.outputs.release_tag }}'
commit-message: 'Update MediaMTX version from v${{ steps.media_mtx.outputs.current_tag }} to v${{ steps.media_mtx.outputs.release_tag }}'
branch: mtx-version
body: |
This pull request updates MediaMTX to the latest version: [v${{ steps.media_mtx.outputs.release_tag }}](https://github.com/bluenviron/mediamtx/releases/tag/v${{ steps.media_mtx.outputs.release_tag }})
add-paths: app/.env
base: main
delete-branch: true
update-wyze-ios:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Get Latest Wyze Release
id: wyze_ios
run: |
release_tag=$(curl -s 'http://itunes.apple.com/lookup?id=1288415553' | jq -r '.results[0].version')
if [[ ! $release_tag =~ ^[0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?$ ]]; then
echo "Invalid version format: ${release_tag}. Exiting workflow."
exit 1
fi
current_tag=$(cat ./app/.env | grep APP_VERSION | cut -d'=' -f2)
sed -i "s/APP_VERSION=.*/APP_VERSION=${release_tag}/" ./app/.env
echo "release_tag=$release_tag" >> $GITHUB_OUTPUT
echo "current_tag=$current_tag" >> $GITHUB_OUTPUT
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
if: steps.wyze_ios.outputs.current_tag != '' && steps.wyze_ios.outputs.current_tag != steps.wyze_ios.outputs.release_tag
with:
title: 'Bump Wyze App version to v${{ steps.wyze_ios.outputs.release_tag }}'
commit-message: 'Update Wyze iOS App version from v${{ steps.wyze_ios.outputs.current_tag }} to v${{ steps.wyze_ios.outputs.release_tag }}'
branch: wyze-version
body: |
This pull request updates the Wyze iOS App version to the latest version: [v${{ steps.wyze_ios.outputs.release_tag }}](https://apps.apple.com/us/app/wyze-make-your-home-smarter/id1288415553)
add-paths: app/.env
base: main
delete-branch: true