syncver #373
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
# Automatic check for updates, if new version is available, submit a pull request | |
# to update the version number in .github/workflows/build.yml | |
name: syncver | |
on: | |
schedule: | |
- cron: "35 4 * * *" | |
push: | |
paths: | |
- .github/workflows/syncver.yml | |
- check-update.py | |
jobs: | |
syncver: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
# only check for head commit | |
ref: main | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.11 | |
- name: Install pip dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install requests semver | |
- name: Check for updates | |
id: check-update | |
# outputs: new_version (if new version is available) | |
run: python check-update.py | |
- name: Create pull request | |
uses: peter-evans/create-pull-request@v5 | |
if: steps.check-update.outputs.new_version != '' | |
with: | |
token: ${{ secrets.CPR_TOKEN }} | |
commit-message: "Sync version to ${{ steps.check-update.outputs.new_version }}" | |
title: "Sync version to ${{ steps.check-update.outputs.new_version }}" | |
body: "Sync version to ${{ steps.check-update.outputs.new_version }}" | |
branch: syncver | |
branch-suffix: timestamp | |
delete-branch: true |