Skip to content

Update main.py

Update main.py #22

Workflow file for this run

# This workflow file is used to automate the packaging and publishing of a Python project to PyPI.
# It is triggered on pushes to the main branch, pull requests to the main branch, and when a new release is created.
# The workflow runs on multiple operating systems (Ubuntu, macOS, Windows) and multiple versions of Python.
# It uses the setup-python action to set up a Python environment.
# It installs necessary packages for packaging and publishing to PyPI.
# It builds the package and publishes it to PyPI when a new release is created.
# The TWINE_USERNAME and TWINE_PASSWORD environment variables are used for authentication with PyPI.
name: Publish Python Package
on:
push:
branches:
- main
pull_request:
branches:
- main
release:
types: [created]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: '3.x'

Check failure on line 27 in .github/workflows/workflow.yaml

View workflow run for this annotation

GitHub Actions / Publish Python Package

Invalid workflow file

The workflow is not valid. .github/workflows/workflow.yaml (Line: 27, Col: 25): Unexpected value '3.x'
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build package
run: python setup.py sdist bdist_wheel
- name: Publish package
if: github.event_name == 'release' && github.event.action == 'created'
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: twine upload dist/*