Skip to content

New version check #3772

New version check

New version check #3772

name: New version check
on:
schedule:
# 3 times a day should be enough
- cron: '07 7,15,23 * * *'
workflow_dispatch:
jobs:
# check-new-stable:
# runs-on: ubuntu-24.04
# steps:
# - uses: actions/checkout@v2
# with:
# ref: stable
# - name: Extract current version
# run: |
# currentversion=$(sed -n 's/^version: "\(.*\)"$/\1/p' snapcraft.yaml)
# echo "current_version=$currentversion" >> $GITHUB_ENV
# - name: Install python deps
# run: sudo apt update && sudo apt install python3-lxml python3-packaging
# - name: Fetch new version
# run: |
# version=$(./.github/scripts/check-new-version.py release ${{ env.current_version }})
# echo "new_version=$version" >> $GITHUB_ENV
# - name: Update snapcraft.yaml with the new version
# if: env.new_version
# run: |
# version=${{ env.new_version }}
# sed -i "s/^version: \"\(.*\)\"$/version: \"$version\"/" snapcraft.yaml
# git add snapcraft.yaml
# git config user.name "Update Bot"
# git config user.email "[email protected]"
# git commit -m "Update to $version."
# git push
check-new-beta:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v2
with:
ref: beta
- name: Extract current version
run: |
currentversion=$(sed -n 's/^version: "\(.*\)"$/\1/p' snapcraft.yaml)
echo "current_version=$currentversion" >> $GITHUB_ENV
- name: Install python deps
run: sudo apt update && sudo apt install python3-lxml python3-packaging
- name: Fetch new version
run: |
version=$(./.github/scripts/check-new-version.py beta ${{ env.current_version }})
echo "new_version=$version" >> $GITHUB_ENV
- name: Update snapcraft.yaml with the new version
if: env.new_version
run: |
version=${{ env.new_version }}
sed -i "s/^version: \"\(.*\)\"$/version: \"$version\"/" snapcraft.yaml
git add snapcraft.yaml
git config user.name "Update Bot"
git config user.email "[email protected]"
git commit -m "Update to $version."
git push