Skip to content

Commit

Permalink
Update build_wheel.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
arjunsuresh authored Nov 23, 2024
1 parent 52910a2 commit 65d9508
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions .github/workflows/build_wheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,17 @@ jobs:
# Step 2: Set up Python
- uses: actions/setup-python@v3

# Step 3: Check if VERSION file has changed in this push
# Step 3: Update the git hash in the repository
- name: Commit updated git hash
run: |
python3 get_git_version.py > git_commit_hash.txt
git config --global user.name mlcommons-bot
git config --global user.email "[email protected]"
git add git_commit_hash.txt
git commit -m "Updated git_commit_hash.txt"
git push
# Step 4: Check if VERSION file has changed in this push
- name: Check if VERSION file has changed
id: version_changed
run: |
Expand All @@ -49,7 +59,7 @@ jobs:
fi
echo "::set-output name=new_version::$new_version"
# Step 4: Increment version if VERSION was not changed
# Step 5: Increment version if VERSION was not changed
- name: Increment version if necessary
id: do_version_increment
if: steps.version_changed.outputs.version_changed == 'false'
Expand All @@ -67,26 +77,24 @@ jobs:
echo "New version: $new_version"
echo "::set-output name=new_version::$new_version"
# Step 5: Commit the updated version to the repository
# Step 6: Commit the updated version to the repository
- name: Commit updated version
if: steps.version_changed.outputs.version_changed == 'false'
run: |
git config --global user.name "${{ github.actor }}"
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
git add VERSION
git commit -m "Increment version to ${{ steps.do_version_increment.outputs.new_version }}"
git push
# Step 6: Install required dependencies
# Step 7: Install required dependencies
- name: Install requirements
run: python3 -m pip install setuptools wheel build

# Step 7: Build the Python wheel
# Step 8: Build the Python wheel
- name: Build wheels
working-directory: ./
run: python3 -m build && rm dist/*.whl

# Step 8: Publish to PyPI
# Step 9: Publish to PyPI
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
Expand Down

0 comments on commit 65d9508

Please sign in to comment.