Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

investigate process for GitHub action based PyPI releases #87

Open
GavinHuttley opened this issue Apr 10, 2024 · 3 comments
Open

investigate process for GitHub action based PyPI releases #87

GavinHuttley opened this issue Apr 10, 2024 · 3 comments
Assignees

Comments

@GavinHuttley
Copy link

we want to be able to have the flit build and publish steps controlled via GitHub actions. For a project, how does this work?

@GavinHuttley
Copy link
Author

  • find example GitHub actions for triggering uploads to PyPI
  • what do we need to configure on PyPI?

@khiron
Copy link

khiron commented Apr 14, 2024

We have to add your PyPI credentials (username and password) as secrets in the GitHub repository.

I think we need to use the pypi-publish github action per this link

There is an example of this in this repo

I think it may look something like this.

name: Build and publish to PyPI

on:
  push:
    branches:
      - main  # or your default branch
  release:
    types: [created]

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    
    - name: Set up Python
      uses: actions/setup-python@v2
      with:
        python-version: '3.x'  # Define the Python version.
    
    - name: Install Flit
      run: python -m pip install flit
    
    - name: Build and Publish
      env:
        FLIT_USERNAME: '__token__'  
        FLIT_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}  
      run: flit publish

I can try to get flit working for the cogent3/app_template project and use the PyPI test server to work on it

@GavinHuttley
Copy link
Author

thanks @khiron !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants