You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GitHub action to automatically publish new releases to PyPi (#448)
Hi, Bruno Ferreira from MLCommons Systems here. This GitHub action
should trigger whenever a new release is created and automatically build
and publish the package to PyPi. The build commands use Twine to build
the package.
# These workflows will upload a Python Package using Twine when a release is created
2
+
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
3
+
4
+
name: Upload Python Package
5
+
6
+
on:
7
+
release:
8
+
types: [created]
9
+
10
+
jobs:
11
+
deploy:
12
+
runs-on: ubuntu-latest
13
+
permissions:
14
+
id-token: write
15
+
steps:
16
+
- uses: actions/checkout@v3
17
+
- name: Set up Python
18
+
uses: actions/setup-python@v3
19
+
with:
20
+
python-version: '3.x'
21
+
- name: Install dependencies
22
+
run: |
23
+
python -m pip install --upgrade pip
24
+
pip install setuptools wheel twine build
25
+
- name: Build distribution
26
+
run: |
27
+
cd python/mlcroissant
28
+
python -m build
29
+
- name: Publish
30
+
uses: pypa/gh-action-pypi-publish@release/v1
31
+
with:
32
+
verify-metadata: true
33
+
skip-existing: true
34
+
packages-dir: python/mlcroissant/dist
35
+
repository-url: https://upload.pypi.org/legacy/
36
+
verbose: true
37
+
env:
38
+
LOGLEVEL: DEBUG
39
+
40
+
# If you wish to publish the package to multiple repositories at once, get inspiration from
0 commit comments