-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add toast updater automator (#24)
* 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
1 parent
2483110
commit eca1ab8
Showing
2 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
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
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.