Skip to content

Commit

Permalink
first try
Browse files Browse the repository at this point in the history
  • Loading branch information
Wauplin committed Jan 28, 2025
1 parent 1d0999d commit b94dad5
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/python-prerelease.yml
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}"

0 comments on commit b94dad5

Please sign in to comment.