Skip to content

Update Nerd Fonts Pypi package #66

Update Nerd Fonts Pypi package

Update Nerd Fonts Pypi package #66

Workflow file for this run

name: Update Nerd Fonts Pypi package
on:
schedule:
- cron: "0 2 * * *" # Runs daily at 02:00 UTC
workflow_dispatch:
jobs:
update_nerdfont:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install Dependencies
run: |
python3 -m pip install -r requirements.txt
- name: Generate Icons
run: |
python3 ./nerdfont/generate.py > ./nerdfont/icons.py
- name: Build Package
run: |
python3 -m build
- name: Install Package
run: |
python3 -m pip install .
# Check if version already exists
- name: Check if version exists
id: check_version
run: |
python3 -c "import requests; print(requests.get('https://pypi.org/pypi/nerdfont/json').json()['releases'].keys())" | grep -q "$(python3 setup.py --version)" && echo "Version already exists" && exit 1 || echo "Version does not exist"
- name: Upload to PyPI
env:
PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
run: |
python3 -m twine upload dist/* -u __token__ -p "$PYPI_API_TOKEN"