barunsaha commited on
Commit
188f682
·
1 Parent(s): b9d847d

Add workflow for publishing Python package

Browse files
.github/workflows/publish-to-pypi.yml ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ push:
6
+ tags:
7
+ - 'v*'
8
+
9
+ permissions:
10
+ contents: read # Default read permission for all jobs
11
+ id-token: write # Overridden for the pypi-publish job
12
+
13
+ jobs:
14
+ pypi-publish:
15
+ name: Upload release to PyPI
16
+ runs-on: ubuntu-latest
17
+ environment:
18
+ name: pypi
19
+ url: https://pypi.org/p/slidedeckai
20
+ permissions:
21
+ id-token: write # Enables OIDC authentication
22
+
23
+ steps:
24
+ - name: Checkout code
25
+ uses: actions/checkout@v4
26
+
27
+ - name: Set up Python
28
+ uses: actions/setup-python@v5
29
+ with:
30
+ python-version: "3.10"
31
+
32
+ - name: Install build tools
33
+ run: |
34
+ python -m pip install --upgrade pip
35
+ pip install build
36
+
37
+ - name: Build package
38
+ run: |
39
+ rm -rf dist/ build/ *.egg-info
40
+ python -m build
41
+
42
+ - name: Publish package to PyPI
43
+ uses: pypa/gh-action-pypi-publish@release/v1
44
+ with:
45
+ packages-dir: dist