Skip to content

autoupdate

autoupdate #2

Workflow file for this run

name: autoupdate
on:
schedule:
- cron: '0 18 10 2-12/2 *'
workflow_dispatch:
jobs:
autoupdate:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.COATL_BOT_GH_TOKEN }}
- name: Fetch latest Python 3.12 release
id: get-python-version
run: |
python-version=$(curl -s https://www.python.org/ftp/python/ | grep -oP '3\.12\.\d+/' | uniq | sort -V | tail -n 1 | tr -d '/')
echo "python3.12: $python-version"
echo ${python_version} > .python-version
echo "python-version=${python-version}" >> $GITHUB_OUTPUT
- name: Detect changes
id: git-diff
uses: coatl-dev/actions/simple-git-diff@v4
- name: Import GPG key
if: ${{ steps.git-diff.outputs.diff == 'true' }}
id: gpg-import
uses: coatl-dev/actions/gpg-import@v4
with:
passphrase: ${{ secrets.COATL_BOT_GPG_PASSPHRASE }}
private-key: ${{ secrets.COATL_BOT_GPG_PRIVATE_KEY }}
- name: Commit and push changes
if: ${{ steps.git-diff.outputs.diff == 'true' }}
run: |
git add -u
git commit \
-m "release: ${{ steps.get-python-version.outputs.python-version }}"
git tag \
-a ${{ steps.get-python-version.outputs.python-version }} \
-m "${{ steps.get-python-version.outputs.python-version }}"
git push origin HEAD --tags