From 05638ec6805416dce42f518bc9226a4c08d68bc9 Mon Sep 17 00:00:00 2001 From: Marcin Date: Mon, 10 Feb 2025 18:15:20 +0100 Subject: [PATCH 1/2] Prepare project for pypi pushing --- .github/workflows/pypi.yml | 51 ++++++++++++++++++++++++++++++++++++++ Makefile | 6 ++++- pyproject.toml | 2 +- 3 files changed, 57 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/pypi.yml diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml new file mode 100644 index 0000000..c76c0cf --- /dev/null +++ b/.github/workflows/pypi.yml @@ -0,0 +1,51 @@ +name: Upload Python Package to PyPI + +on: + release: + types: [published] + +permissions: + contents: read + +jobs: + release-build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: "3.13" + + - name: Build release distributions + run: + make build_wheel + + - name: Upload distributions + uses: actions/upload-artifact@v4 + with: + name: release-dists + path: dist/ + + pypi-publish: + runs-on: ubuntu-latest + needs: + - release-build + permissions: + id-token: write + + environment: + name: pypi + + steps: + - name: Retrieve release distributions + uses: actions/download-artifact@v4 + with: + name: release-dists + path: dist/ + + - name: Publish release distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + packages-dir: dist/ diff --git a/Makefile b/Makefile index 5464c3f..d11c459 100644 --- a/Makefile +++ b/Makefile @@ -3,9 +3,13 @@ all_code = src tests install: pip install -e . -setup: install +install_dev: install pre-commit install +build_wheel: + pip install wheel twine + python -m build --wheel . --outdir dist/ + docker: clean docker build . -t mlojek/optilab diff --git a/pyproject.toml b/pyproject.toml index b8e35c6..16bbe88 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,4 +36,4 @@ dependencies = [ ] [project.urls] -Homepage = "github.com/mlojek/optilab" \ No newline at end of file +Homepage = "https://github.com/mlojek/optilab" \ No newline at end of file From 2b2273e40daa3c10611ffdb76d4041c01ad58b9f Mon Sep 17 00:00:00 2001 From: Marcin Date: Mon, 10 Feb 2025 18:16:09 +0100 Subject: [PATCH 2/2] Bump version to 19 --- docs/conf.py | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index d55fa77..2bf7298 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -13,7 +13,7 @@ project = 'optilab' copyright = '2025, Marcin Łojek' author = 'Marcin Łojek' -release = '18' +release = '19' # -- General configuration --------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration diff --git a/pyproject.toml b/pyproject.toml index 16bbe88..a6c40f9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "optilab" -version = "18" +version = "19" authors = [ { name="mlojek", email="marcin.lojek@pw.edu.pl" }, ]