Skip to content

Commit

Permalink
ci: add toast updater automator (#24)
Browse files Browse the repository at this point in the history
* ci: add toast updater automator

* fix(infra): update package to not fail

* ci:  add dispatching for ci runs

* ci: remove unused dispatch
  • Loading branch information
JacobCoffee authored Apr 10, 2024
1 parent 2483110 commit eca1ab8
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/update-toast.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Check Litestar Release

on:
schedule:
- cron: '0 0 * * *' # Run every night at midnight
workflow_run:
workflows: ["Tests and Linting"]
types:
- completed

jobs:
check_release:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Get latest Litestar release
id: latest_release
run: |
latest_release=$(curl -s https://api.github.com/repos/litestar-org/litestar/releases/latest | jq -r '.tag_name')
echo "::set-output name=version::$latest_release"
- name: Update conf.py
if: steps.latest_release.outputs.version != env.CURRENT_VERSION
env:
CURRENT_VERSION: v2.8.2
run: |
sed -i "s/Litestar $CURRENT_VERSION/Litestar ${{ steps.latest_release.outputs.version }}/g" conf.py
sed -i "s|/release-notes/changelog.html#$CURRENT_VERSION|/release-notes/changelog.html#${{ steps.latest_release.outputs.version }}|g" conf.py
- name: Update workflow file
if: steps.latest_release.outputs.version != env.CURRENT_VERSION
run: |
sed -i "s/CURRENT_VERSION: $CURRENT_VERSION/CURRENT_VERSION: ${{ steps.latest_release.outputs.version }}/g" .github/workflows/check-litestar-release.yml
- name: Create pull request
if: steps.latest_release.outputs.version != env.CURRENT_VERSION
uses: peter-evans/create-pull-request@v3
with:
commit-message: Update Litestar version to ${{ steps.latest_release.outputs.version }}
title: Update Litestar version to ${{ steps.latest_release.outputs.version }}
body: |
A new Litestar release (${{ steps.latest_release.outputs.version }}) has been detected.
This PR updates the version in the `conf.py` file and the `CURRENT_VERSION` in the workflow file.
branch: update-litestar-version
Empty file added src/litestar_dev/__init__.py
Empty file.

0 comments on commit eca1ab8

Please sign in to comment.