-
Notifications
You must be signed in to change notification settings - Fork 601
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
57 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,57 @@ | ||
name: Python prerelease | ||
|
||
on: | ||
workflow_dispatch: # TODO: remove this before merging | ||
# push: | ||
# tags: | ||
# - v*.rc* | ||
|
||
jobs: | ||
test_on_transformers: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: Extract version from tag | ||
id: get-version | ||
# run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT | ||
run: echo "VERSION=v0.27.0rc1" >> $GITHUB_OUTPUT # TODO: remove this before merging | ||
|
||
- name: Checkout transformers | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: huggingface/transformers | ||
path: transformers | ||
token: ${{ secrets.TOKEN_INFERENCE_SYNC_BOT }} | ||
|
||
- name: Configure Git | ||
run: | | ||
cd transformers | ||
git config user.name "Hugging Face Bot" | ||
git config user.email "[email protected]" | ||
- name: Create test branch and update dependencies | ||
id: create-pr | ||
run: | | ||
cd transformers | ||
VERSION=${{ steps.get-version.outputs.VERSION }} | ||
BRANCH_NAME="ci-test-huggingface-hub-${VERSION}" | ||
# Create and checkout new branch | ||
git checkout -b $BRANCH_NAME | ||
# Update dependencies using sed | ||
sed -i -E 's/"huggingface-hub>=0.*"/"huggingface-hub=='${VERSION}'"/' setup.py | ||
sed -i -E 's/"huggingface-hub>=0.*"/"huggingface-hub=='${VERSION}'"/' src/transformers/dependency_versions_table.py | ||
# Commit and push changes | ||
git --no-pager diff | ||
git add setup.py src/transformers/dependency_versions_table.py | ||
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/huggingface/transformers/actions" | ||
echo "https://github.com/huggingface/transformers/compare/main...ci-test-huggingface-hub-${VERSION}" |