latest pins #517
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
name: "latest pins" | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '25 4,16 * * *' | |
jobs: | |
update_pins: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: main | |
- name: Install uv | |
uses: astral-sh/setup-uv@f064c84ddba8609eaa6f191659f0f166260f175b | |
with: | |
version: "0.5.7" | |
- run: uv --directory ${{ runner.temp }} init | |
--name install-pinned | |
--no-workspace | |
--no-readme | |
--no-pin-python | |
--python 3.8 | |
- run: uv --directory ${{ runner.temp }} add --no-sync uv | |
- run: uv --directory ${{ runner.temp }} export -o ${{ github.workspace }}/requirements.txt | |
- run: | | |
if [ -n "$(git status --porcelain)" ]; then | |
git config --global user.name "install-pinned bot" | |
git config --global user.email "[email protected]" | |
git add --all | |
ver=$(curl -Ls https://pypi.org/pypi/uv/json | jq -r .info.version) | |
git commit -m "update pins (uv $ver)" | |
commit=$(git rev-parse HEAD) | |
sed -i -E "s/@[0-9a-f]{40}.*/@$commit # $ver/g" README.md | |
git commit -am "update README.md (uv $ver)" | |
git push | |
fi |