Skip to content

Commit

Permalink
ci: Update Dockerfile and add GitHub Actions workflow for PyPI publis…
Browse files Browse the repository at this point in the history
…hing

Signed-off-by: Eden Reich <[email protected]>
  • Loading branch information
edenreich committed Jan 19, 2025
1 parent 1213581 commit 3dd393a
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 6 deletions.
11 changes: 7 additions & 4 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,21 @@ FROM mcr.microsoft.com/devcontainers/python:3.12-bookworm
ENV BLACK_VERSION=24.10.0 \
ISORT_VERSION=5.13.2 \
PYLINT_VERSION=3.3.3 \
BUILD_VERSION=1.2.2.post1 \
TWINE_VERSION=6.0.1 \
ZSH_CUSTOM=/home/vscode/.oh-my-zsh/custom

RUN apt-get update && \
# Install powerlevel10k theme
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM}/themes/powerlevel10k && \
# Install pipx
python -m pip install --upgrade pip && \
python -m pip install pipx && \
# Install black, isort, pylint using pipx
pipx install black==${BLACK_VERSION} && \
pipx install isort==${ISORT_VERSION} && \
pipx install pylint==${PYLINT_VERSION} && \
pip install black==${BLACK_VERSION} && \
pip install isort==${ISORT_VERSION} && \
pip install pylint==${PYLINT_VERSION} && \
pip install build==${BUILD_VERSION} && \
pip install twine==${TWINE_VERSION} && \
# Clean up
apt-get clean && \
rm -rf /var/lib/apt/lists/*
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Release

on:
push:
tags:
- 'v*.*.*'

jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Check out the code
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install build twine --user
- name: Build the package
run: |
python -m build
- name: Publish to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
twine upload dist/*
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.vscode
.pytest_cache
**/__pycache__
dist
**.egg-info
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ classifiers = [
"Programming Language :: Python :: 3",
"Operating System :: OS Independent",
]
license = "MIT"
license-files = ["LICEN[CS]E*"]
license = { file = "LICENSE" }

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

0 comments on commit 3dd393a

Please sign in to comment.