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

Build GitHub workflow to deploy Python library to Pypi #1230

Closed
3 tasks done
bossenti opened this issue Feb 6, 2023 · 3 comments · Fixed by #1280
Closed
3 tasks done

Build GitHub workflow to deploy Python library to Pypi #1230

bossenti opened this issue Feb 6, 2023 · 3 comments · Fixed by #1280
Assignees
Labels
gh-actions Pull requests that update GitHub Actions code python Pull requests that update Python code
Milestone

Comments

@bossenti
Copy link
Contributor

bossenti commented Feb 6, 2023

Body

To deploy out Python library to pypi.org we need a dedicated GitHub workflow since we do not publish snapshot versions in the beginning. This workflow should only be triggered manually, which will be done during the release process. It only needs to build the wheel and publish the it to Pypi using setup.py.

We will test/run this during the release process of 0.91.0.

StreamPipes Committer

I acknowledge that I am a maintainer/committer of the Apache StreamPipes project.

@bossenti bossenti added this to the 0.91.0 milestone Feb 6, 2023
@bossenti bossenti added python Pull requests that update Python code gh-actions Pull requests that update GitHub Actions code labels Feb 6, 2023
@kulbachcedric
Copy link
Contributor

Hi @SvenO3 and @bossenti,
I just saw this issue and did the PyPi deployment once with deep-river.
This workflow might help, whereby the secrets.PYPI_API_TOKEN needs to be set within the settings of the streampipes repository.
Further, the path to the python libraries (python-wrapper and python-functional) needs to be changed.

# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Upload Python Package

on:
  release:
    types: [published]

permissions:
  contents: read

jobs:
  deploy:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v3
    - name: Set up Python
      uses: actions/setup-python@v3
      with:
        python-version: '3.x'
    - name: Install dependencies
      run: |
        python -m pip install --upgrade pip
        pip install build
    - name: Build package
      run: python -m build
    - name: Publish package
      uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
      with:
        user: __token__
        password: ${{ secrets.PYPI_API_TOKEN }}

Hope this helps!
Best
Cedric

@bossenti bossenti changed the title Built GitHub workflow to deploy Python library to Pypi Build GitHub workflow to deploy Python library to Pypi Feb 10, 2023
@bossenti
Copy link
Contributor Author

Thanks a lot for that hint @kulbachcedric 🙂

@SvenO3 SvenO3 linked a pull request Feb 13, 2023 that will close this issue
SvenO3 added a commit that referenced this issue Feb 14, 2023
Add workflow to deploy Python library to PyPi (#1230)
@SvenO3 SvenO3 reopened this Feb 14, 2023
@bossenti bossenti self-assigned this Mar 10, 2023
@bossenti
Copy link
Contributor Author

documentation on confluence is added

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gh-actions Pull requests that update GitHub Actions code python Pull requests that update Python code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants