Skip to content

Use auto deploy to pypi #9

@pomponchik

Description

@pomponchik

Hello!

I suspect that the reason for the problems with uploading new versions of your library may be the fact that you do not use the workflow for auto-deploy.

I have an example of it. You need create a file .github/workflows/release.yml with content like this:

name: Release

on:
  push:
    branches:
      - main

jobs:
  pypi-publish:
    name: upload release to PyPI
    runs-on: ubuntu-latest
    # Specifying a GitHub environment is optional, but strongly encouraged
    environment: release
    permissions:
      # IMPORTANT: this permission is mandatory for trusted publishing
      id-token: write
    steps:
      - uses: actions/checkout@v2

      - name: Set up Python ${{ matrix.python-version }}
        uses: actions/setup-python@v1
        with:
            python-version: ${{ matrix.python-version }}

      - name: Install dependencies
        shell: bash
        run: pip install -r requirements_dev.txt

      - name: Build the project
        shell: bash
        run: python -m build .

      - name: Publish package distributions to PyPI
        uses: pypa/gh-action-pypi-publish@release/v1

Also you need register a trusted publisher on pypi.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions