mirror of
https://github.com/astral-sh/setup-uv.git
synced 2025-10-18 16:46:58 +00:00
71 lines
2.5 KiB
YAML
71 lines
2.5 KiB
YAML
name: "Update known versions"
|
|
on:
|
|
workflow_dispatch:
|
|
schedule:
|
|
- cron: "0 4 * * *" # Run every day at 4am UTC
|
|
repository_dispatch:
|
|
types: [ pypi_release ]
|
|
|
|
permissions: {}
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-24.04-arm
|
|
permissions:
|
|
contents: write
|
|
pull-requests: write
|
|
steps:
|
|
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
|
with:
|
|
persist-credentials: true
|
|
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
|
|
with:
|
|
node-version: "20"
|
|
- name: Update known versions
|
|
id: update-known-versions
|
|
run:
|
|
node dist/update-known-versions/index.js
|
|
src/download/checksum/known-checksums.ts
|
|
version-manifest.json
|
|
${{ secrets.GITHUB_TOKEN }}
|
|
- name: Check for changes
|
|
id: changes-exist
|
|
run: |
|
|
git status --porcelain
|
|
if [ -n "$(git status --porcelain)" ]; then
|
|
echo "changes-exist=true" >> "$GITHUB_OUTPUT"
|
|
else
|
|
echo "changes-exist=false" >> "$GITHUB_OUTPUT"
|
|
fi
|
|
- name: Compile changes
|
|
if: ${{ steps.changes-exist.outputs.changes-exist == 'true' }}
|
|
run: npm ci && npm run all
|
|
- name: Commit and push changes
|
|
if: ${{ steps.changes-exist.outputs.changes-exist == 'true' }}
|
|
id: commit-and-push
|
|
continue-on-error: true
|
|
run: |
|
|
git config user.name "$GITHUB_ACTOR"
|
|
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
|
|
git add .
|
|
git commit -m "chore: update known versions for $LATEST_VERSION"
|
|
git push origin HEAD:refs/heads/main
|
|
env:
|
|
LATEST_VERSION: ${{ steps.update-known-versions.outputs.latest-version }}
|
|
|
|
- name: Create Pull Request
|
|
if: ${{ steps.changes-exist.outputs.changes-exist == 'true' && steps.commit-and-push.outcome != 'success' }}
|
|
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8
|
|
with:
|
|
commit-message: "chore: update known checksums"
|
|
title:
|
|
"chore: update known checksums for ${{
|
|
steps.update-known-versions.outputs.latest-version }}"
|
|
body:
|
|
"chore: update known checksums for ${{
|
|
steps.update-known-versions.outputs.latest-version }}"
|
|
base: main
|
|
labels: "automated-pr,update-known-versions"
|
|
branch: update-known-versions-pr
|
|
delete-branch: true
|