diff --git a/.github/workflows/ci-ifctester-pypi.yml b/.github/workflows/ci-ifctester-pypi.yml new file mode 100644 index 0000000000..4bb65a9337 --- /dev/null +++ b/.github/workflows/ci-ifctester-pypi.yml @@ -0,0 +1,57 @@ +name: ci-ifctester-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 * *" + push: + paths: + - '.github/workflows/ci-ifctester-pypi.yml' + + +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 + name: ${{ matrix.config.name }}-${{ matrix.pyver }} + 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.10' # Version range or exact version of a Python version to use, using SemVer's version range syntax + architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified + - run: echo ${{ env.DATE }} + - name: Get current date + id: date + run: echo "::set-output name=date::$(date +'%y%m%d')" + - name: Compile + run: | + pip install build + cd src/ifctester && + 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/ifctester/dist diff --git a/src/ifctester/Makefile b/src/ifctester/Makefile index f1c493c390..597a8ccb99 100644 --- a/src/ifctester/Makefile +++ b/src/ifctester/Makefile @@ -1,3 +1,16 @@ +VERSION:=`date '+%y%m%d'` +SED:=sed -i +ifeq ($(UNAME_S),Darwin) +SED:=sed -i '' -e +endif + .PHONY: test test: pytest -p no:pytest-blender test + +.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/ifctester/pyproject.toml b/src/ifctester/pyproject.toml new file mode 100644 index 0000000000..38b930aaa7 --- /dev/null +++ b/src/ifctester/pyproject.toml @@ -0,0 +1,25 @@ +[build-system] +requires = ["setuptools>=61.0"] +build-backend = "setuptools.build_meta" +[project] +name = "ifctester" +version = "0.0.999999" +authors = [ + { name="Dion Moult", email="dion@thinkmoult.com" }, +] +description = "IFC model auditing tool with support for IDS" +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" +"Bug Tracker" = "https://github.com/ifcopenshell/ifcopenshell/issues" +[tool.setuptools.packages.find] +include = ["ifctester"] +exclude = ["test*"]