Skip to content

Commit

Permalink
Squelette pour de futurs publish automatiques sur pypi (#102)
Browse files Browse the repository at this point in the history
* Test publish sur pypi

* remove tag

* cartiflette url

* clean

* pin version

* update

* try token
  • Loading branch information
linogaliana authored Oct 10, 2024
1 parent 9902db9 commit 2e38b5f
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Upload Python Package

on:
push:
branches:
- 'pypi'

permissions:
contents: read

jobs:
release-build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4 # Ensure actions are pinned properly

- uses: actions/setup-python@v5
with:
python-version: "3.x"

- name: Build release distributions
run: |
python -m pip install build
python -m build
- name: Upload distributions
uses: actions/upload-artifact@v4
with:
name: release-dists
path: dist/

publish:
runs-on: ubuntu-latest

needs:
- release-build

permissions:
id-token: write
contents: read # Added this permission

environment:
name: publish
url: https://pypi.org/p/cartiflette

steps:
- name: Retrieve release distributions
uses: actions/download-artifact@v4
with:
name: release-dists
path: dist/

- name: Publish release distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_PASSWORD }} # Ensure the secret name is correct
5 changes: 5 additions & 0 deletions cartiflette/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
from cartiflette.api import download_from_cartiflette_inner

print("This is an experimental version of cartiflette published on PyPi.")
print("To use the latest stable version, you can install it directly from GitHub with the following command:")
print("pip install git+https://github.com/inseeFrLab/cartiflette.git")


carti_download = download_from_cartiflette_inner

__all__ = ["carti_download"]

0 comments on commit 2e38b5f

Please sign in to comment.