Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 81 additions & 0 deletions .github/workflows/pre-release-testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: hf-xet prerelease testing
# This workflow is triggered when a new pre-release build is triggered by the release workflow.

on:
push:
tags:
- v*rc*
workflow_dispatch:
inputs:
tag:
description: "Tag to test (e.g., v1.0.3rc2)"
required: true
jobs:
trigger_rc_testing:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
target-repo: ["huggingface_hub"]

steps:
- name: Determine version from tag
id: get-version
run: |
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
echo "VERSION=${{ inputs.tag }}" >> $GITHUB_OUTPUT
else
echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
fi

- name: Checkout target repo
uses: actions/checkout@v4
with:
repository: huggingface/${{ matrix.target-repo }}
path: ${{ matrix.target-repo }}
token: ${{ secrets.TOKEN_HUGGINGFACE_HUB_AUTO_BY_XET }}

- name: Configure Git
run: |
cd ${{ matrix.target-repo }}
git config user.name "Hugging Face Bot (Xet RC Testing)"
git config user.email "[email protected]"

- name: Wait for prerelease to be out on PyPI
run: |
VERSION=${{ steps.get-version.outputs.VERSION }}
echo "Waiting for hf_xet==${VERSION} to be available on PyPI"
while ! pip install hf_xet==${VERSION}; do
echo "hf_xet==${VERSION} not available yet, retrying in 15s"
sleep 15
done

- name: Create test branch and update dependencies
id: create-pr
run: |
cd ${{ matrix.target-repo }}
VERSION=${{ steps.get-version.outputs.VERSION }}
BRANCH_NAME="ci-test-hf-xet-${VERSION}-release"

# Create and checkout new branch
git checkout -b $BRANCH_NAME

# Update dependencies using sed
sed -i -E "s/\"hf_xet>=*\"/\"hf_xet==${VERSION}\"/" setup.py
git add setup.py

# Any line with `uv pip install --prerelease=allow` in the `.github/` folder must be updated with `--prerelease=allow` flag
find .github/workflows/ -type f -exec sed -i 's/uv pip install /uv pip install --prerelease=allow /g' {} +
git add .github/workflows/

# Commit and push changes
git --no-pager diff --staged
git commit -m "Test hfh ${VERSION}"
git push --set-upstream origin $BRANCH_NAME

- name: Print URLs for manual check
run: |
VERSION=${{ steps.get-version.outputs.VERSION }}
echo "https://github.com/xet-core/${{ matrix.target-repo }}/actions"
echo "https://github.com/xet-core/${{ matrix.target-repo }}/compare/main...${BRANCH_NAME}"