From 0168c0ee26b90f44497d7cf17162d970ff1f93e2 Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Mon, 8 Apr 2024 10:24:04 +1000 Subject: [PATCH] See #4529. Publish IfcPatch to PyPI. --- .github/workflows/ci-ifcpatch-pypi.yaml | 48 +++++++++++++++++++++++++ src/ifcpatch/Makefile | 7 ++++ src/ifcpatch/pyproject.toml | 29 +++++++++++++++ 3 files changed, 84 insertions(+) create mode 100644 .github/workflows/ci-ifcpatch-pypi.yaml create mode 100644 src/ifcpatch/pyproject.toml diff --git a/.github/workflows/ci-ifcpatch-pypi.yaml b/.github/workflows/ci-ifcpatch-pypi.yaml new file mode 100644 index 0000000000..710c3fba74 --- /dev/null +++ b/.github/workflows/ci-ifcpatch-pypi.yaml @@ -0,0 +1,48 @@ +name: ci-ifcpatch-pypi + +on: + schedule: + # ┌───────────── minute (0 - 59) + # │ ┌───────────── hour (0 - 23) + # │ │ ┌───────────── day of the month (1 - 31) + # │ │ │ ┌───────────── month (1 - 12 or JAN-DEC) + # │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT) + # * * * * * + - cron: "0 0 18 * *" + workflow_dispatch: + +env: + major: 0 + minor: 0 + name: ifcopenshell + +jobs: + activate: + runs-on: ubuntu-latest + if: | + github.repository == 'IfcOpenShell/IfcOpenShell' + steps: + - name: Set env + run: echo ok go + + build: + needs: activate + runs-on: ubuntu-latest + strategy: + fail-fast: false + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 # https://github.com/actions/setup-python + with: + python-version: '3.11' # Version range or exact version of a Python version to use, using SemVer's version range syntax + - name: Compile + run: | + pip install build + cd src/ifcpatch && + make dist + - name: Publish a Python distribution to PyPI + uses: ortega2247/pypi-upload-action@master + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} + packages_dir: src/ifcpatch/dist diff --git a/src/ifcpatch/Makefile b/src/ifcpatch/Makefile index 1909562a75..4fa62f5ff0 100644 --- a/src/ifcpatch/Makefile +++ b/src/ifcpatch/Makefile @@ -23,3 +23,10 @@ test: .PHONY: qa qa: black . + +.PHONY: dist +dist: + rm -rf dist + $(SED) "s/999999/$(VERSION)/" pyproject.toml + python -m build + $(SED) "s/$(VERSION)/999999/" pyproject.toml diff --git a/src/ifcpatch/pyproject.toml b/src/ifcpatch/pyproject.toml new file mode 100644 index 0000000000..6ef101fe48 --- /dev/null +++ b/src/ifcpatch/pyproject.toml @@ -0,0 +1,29 @@ +[build-system] +requires = ["setuptools>=61.0"] +build-backend = "setuptools.build_meta" + +[project] +name = "ifcpatch" +version = "0.0.999999" +authors = [ + { name="Dion Moult", email="dion@thinkmoult.com" }, +] +description = "IFC patching utility" +readme = "README.md" +keywords = ["IFC", "IDS", "BIM"] +classifiers = [ + "Programming Language :: Python :: 3", + "License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)", +] +dependencies = [ + "ifcopenshell", +] + +[project.urls] +Homepage = "http://ifcopenshell.org" +Documentation = "https://docs.ifcopenshell.org" +Issues = "https://github.com/IfcOpenShell/IfcOpenShell/issues" + +[tool.setuptools.packages.find] +include = ["ifcpatch"] +exclude = ["test*"]