Skip to content

Commit 3dd393a

Browse files
committed
ci: Update Dockerfile and add GitHub Actions workflow for PyPI publishing
Signed-off-by: Eden Reich <[email protected]>
1 parent 1213581 commit 3dd393a

File tree

4 files changed

+46
-6
lines changed

4 files changed

+46
-6
lines changed

.devcontainer/Dockerfile

+7-4
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,21 @@ FROM mcr.microsoft.com/devcontainers/python:3.12-bookworm
33
ENV BLACK_VERSION=24.10.0 \
44
ISORT_VERSION=5.13.2 \
55
PYLINT_VERSION=3.3.3 \
6+
BUILD_VERSION=1.2.2.post1 \
7+
TWINE_VERSION=6.0.1 \
68
ZSH_CUSTOM=/home/vscode/.oh-my-zsh/custom
79

810
RUN apt-get update && \
911
# Install powerlevel10k theme
1012
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM}/themes/powerlevel10k && \
1113
# Install pipx
1214
python -m pip install --upgrade pip && \
13-
python -m pip install pipx && \
1415
# Install black, isort, pylint using pipx
15-
pipx install black==${BLACK_VERSION} && \
16-
pipx install isort==${ISORT_VERSION} && \
17-
pipx install pylint==${PYLINT_VERSION} && \
16+
pip install black==${BLACK_VERSION} && \
17+
pip install isort==${ISORT_VERSION} && \
18+
pip install pylint==${PYLINT_VERSION} && \
19+
pip install build==${BUILD_VERSION} && \
20+
pip install twine==${TWINE_VERSION} && \
1821
# Clean up
1922
apt-get clean && \
2023
rm -rf /var/lib/apt/lists/*

.github/workflows/release.yml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*'
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Check out the code
13+
uses: actions/checkout@v4
14+
with:
15+
persist-credentials: false
16+
17+
- name: Set up Python
18+
uses: actions/setup-python@v5
19+
with:
20+
python-version: '3.12'
21+
22+
- name: Install dependencies
23+
run: |
24+
python3 -m pip install --upgrade pip
25+
python3 -m pip install build twine --user
26+
27+
- name: Build the package
28+
run: |
29+
python -m build
30+
31+
- name: Publish to PyPI
32+
env:
33+
TWINE_USERNAME: __token__
34+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
35+
run: |
36+
twine upload dist/*

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
.vscode
22
.pytest_cache
33
**/__pycache__
4+
dist
5+
**.egg-info

pyproject.toml

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ classifiers = [
1111
"Programming Language :: Python :: 3",
1212
"Operating System :: OS Independent",
1313
]
14-
license = "MIT"
15-
license-files = ["LICEN[CS]E*"]
14+
license = { file = "LICENSE" }
1615

1716
[project.urls]
1817
Homepage = "https://github.com/edenreich/inference-gateway-python-sdk"

0 commit comments

Comments
 (0)