Skip to content

Commit 8909246

Browse files
committed
publiusg
1 parent 02ca739 commit 8909246

File tree

1 file changed

+48
-1
lines changed

1 file changed

+48
-1
lines changed
Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,48 @@
1-
1+
name: Publish Python SEC API SDK to PyPI
2+
3+
on:
4+
push:
5+
branches:
6+
- main # Or your primary branch name
7+
paths:
8+
- 'finfeedapi/sec-api/sdk/python/**' # Watch for changes in the Python SDK directory
9+
10+
jobs:
11+
pypi-publish:
12+
name: upload release to PyPI
13+
runs-on: ubuntu-latest
14+
# Ensure this environment is configured in your GitHub settings for PyPI trusted publishing
15+
# It should be configured to allow deployments from this repository and branch/tag.
16+
environment: pypi
17+
permissions:
18+
id-token: write # Required for OIDC trusted publishing
19+
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v4
23+
24+
- name: Set up Python
25+
uses: actions/setup-python@v4
26+
with:
27+
python-version: '3.9' # Specify your desired Python version (e.g., 3.8, 3.9, 3.10, 3.11)
28+
29+
- name: Install build dependencies
30+
run: |
31+
python -m pip install --upgrade pip
32+
pip install build wheel setuptools
33+
34+
- name: Build package distributions
35+
# Change working directory to where your pyproject.toml or setup.py is located
36+
working-directory: finfeedapi/sec-api/sdk/python
37+
run: python -m build --sdist --wheel --outdir dist/ .
38+
# This command builds the package and places the .tar.gz and .whl files
39+
# into finfeedapi/sec-api/sdk/python/dist/
40+
41+
- name: Publish package distributions to PyPI
42+
uses: pypa/gh-action-pypi-publish@release/v1
43+
with:
44+
# packages-dir should point to the directory containing the built distributions
45+
packages-dir: finfeedapi/sec-api/sdk/python/dist/
46+
# For trusted publishing, user and password/token are not needed here.
47+
# The action will automatically use the OIDC token obtained via the id-token permission.
48+
# Ensure your PyPI project is configured to trust publishes from this GitHub repository/workflow.

0 commit comments

Comments
 (0)