From f2c31cc17d19bb7f85e13cc56e1917edb7e67115 Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Wed, 31 Aug 2022 16:02:39 +1000 Subject: [PATCH] Add optimistic Github action to upload wheels to PyPi --- .github/workflows/ci-ifcopenshell-pypi.yml | 67 ++++++++++++++++++++++ src/ifcopenshell-python/Makefile | 1 - 2 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/ci-ifcopenshell-pypi.yml diff --git a/.github/workflows/ci-ifcopenshell-pypi.yml b/.github/workflows/ci-ifcopenshell-pypi.yml new file mode 100644 index 0000000000..28c3649ddf --- /dev/null +++ b/.github/workflows/ci-ifcopenshell-pypi.yml @@ -0,0 +1,67 @@ +name: Publish-ifcopenshell-multiplatform + +on: + push: + paths: + - '.github/workflows/ci-ifcopenshell-pypi.yml' + - 'src/ifcopenshell-python/ifcopenshell/**' + branches: + - v0.7.0 + +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 + matrix: + pyver: [py36, py37, py38, py39, py310] + config: + - { + name: "Windows Build", + short_name: win, + } + - { + name: "Linux Build", + short_name: linux + } + - { + name: "MacOS Build", + short_name: macos + } + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 # https://github.com/actions/setup-python + with: + python-version: '3.7.7' # 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 + cp -r src/ifcopenshell-python src/ifcopenshell-python_${{ matrix.config.short_name }}_${{ matrix.pyver }} && + cd src/ifcopenshell-python_${{ matrix.config.short_name }}_${{ matrix.pyver }} && + make dist PLATFORM=${{ matrix.config.short_name }} PYVERSION=${{ matrix.pyver }} + - name: Publish a Python distribution to PyPI + uses: ortega2247/pypi-upload-action@master + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} + packages_dir: src/ifcopenshell-python/dist diff --git a/src/ifcopenshell-python/Makefile b/src/ifcopenshell-python/Makefile index 35b8c48d94..d78d59de86 100644 --- a/src/ifcopenshell-python/Makefile +++ b/src/ifcopenshell-python/Makefile @@ -4,7 +4,6 @@ PLATFORM:=linux ifeq ($(PYVERSION), py36) PYNUMBER:=36 -ABITAG:=cp36m endif ifeq ($(PYVERSION), py37) PYNUMBER:=37