🚀 Release: v0.3.10rc3 #26
Workflow file for this run
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
name: Prerelease Build | |
on: | |
push: | |
tags: ["v[0-9]+.[0-9]+.[0-9]+rc[0-9]+"] | |
branches: ["*"] | |
jobs: | |
pypi_deploy: | |
name: Deploy to PyPI | |
runs-on: ubuntu-latest | |
if: ${{ github.ref_type == 'tag' && startsWith(github.ref_name, 'v') }} | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.head_ref }} | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: "3.11" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
pip install build | |
pip install twine | |
- name: Build Package | |
run: | | |
python -m build | |
- name: Check Package | |
run: | | |
twine check dist/* --strict | |
- name: Publish to PyPI | |
env: | |
TWINE_USERNAME: __token__ | |
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} | |
run: | | |
twine upload dist/* --verbose | |
huggingface_deploy: | |
name: Deploy to Hugging Face | |
runs-on: ubuntu-latest | |
needs: pypi_deploy | |
if: ${{ github.ref_type == 'tag' && startsWith(github.ref_name, 'v') }} | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.head_ref }} | |
fetch-depth: 0 | |
- name: Setup Git Config | |
run: | | |
git checkout main | |
git config --global user.email "34169605+hasaniqbal777@users.noreply.github.com" | |
git config --global user.name "Hasan Iqbal" | |
- name: Enable HuggingFace Spaces Config | |
run: | | |
READMEFILE="README.md" | |
sed -i 's/<!--/---/g; s/-->/---/g' $READMEFILE | |
sed -i 's/^title: OpenFactCheck$/title: OpenFactCheck Prelease/' $READMEFILE | |
git add $READMEFILE | |
git commit -m "Uncommented HuggingFace Spaces Configuration" || echo "No changes to commit" | |
- name: Wait for 10 seconds | |
run: sleep 10 | |
- name: Push to Hugging Face | |
env: | |
HF_TOKEN: ${{ secrets.HF_TOKEN }} | |
run: git push https://hasaniqbal777:$HF_TOKEN@huggingface.co/spaces/hasaniqbal777/OpenFactCheck-Prerelease main --force |