diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 96b8cb3..03d24f2 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,56 +1,50 @@ -name: Publish Python Package +# .github/workflows/publish.yml + +name: Publish Package on: push: branches: - - master + - main jobs: test: runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v3 + - name: Check out code + uses: actions/checkout@v2 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v3 with: - python-version: '3.x' + python-version: '3.11' # Set your Python version here - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -r requirements.txt - pip install pytest + run: pip install -r requirements.txt - name: Run tests run: pytest tests/ publish: runs-on: ubuntu-latest - needs: test # Run only if tests succeed - + needs: test steps: - - name: Checkout repository - uses: actions/checkout@v3 + - name: Check out code + uses: actions/checkout@v2 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v3 with: - python-version: '3.x' + python-version: '3.11' - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install setuptools wheel twine + run: pip install -r requirements.txt - name: Build package run: python setup.py sdist bdist_wheel - - name: Publish package to PyPI - env: - TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} - TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} - run: | - twine upload dist/* + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@v1.7.1 + with: + password: ${{ secrets.PYPI_API_TOKEN }} +