From 153a71f91e8a7fdd825e35071b7992af9578e2b8 Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Fri, 26 Jul 2024 20:04:04 +1000 Subject: [PATCH] Distribute IfcConvert on GH actions --- .github/workflows/ci-ifcconvert.yml | 65 +++++++++++++++++++++++++++++ src/ifcopenshell-python/Makefile | 11 ++++- 2 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/ci-ifcconvert.yml diff --git a/.github/workflows/ci-ifcconvert.yml b/.github/workflows/ci-ifcconvert.yml new file mode 100644 index 0000000000..d47dad04ba --- /dev/null +++ b/.github/workflows/ci-ifcconvert.yml @@ -0,0 +1,65 @@ +name: ci-ifcconvert + +on: + workflow_dispatch: + +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: + config: + - { + name: "Windows 64bit", + short_name: win64, + } + - { + name: "Windows 32bit", + short_name: win32, + } + - { + name: "Linux 64bit", + short_name: linux64 + } + - { + name: "MacOS Intel 64bit", + short_name: macos64 + } + - { + name: "MacOS Silicon 64bit", + short_name: macosm164 + } + 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 + architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified + - run: echo ${{ env.DATE }} + - name: Get current version + id: version + run: echo "version=$(cat VERSION)" >> $GITHUB_OUTPUT + - name: Compile + run: | + cd src/ifcopenshell-python && + make zip-ifcconvert PLATFORM=${{ matrix.config.short_name }} + - name: Upload zip file to release + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: src/ifcopenshell-python/dist/ifcconvert-${{ steps.version.outputs.version }}-${{ matrix.config.short_name }}.zip + asset_name: ifcconvert-${{ steps.version.outputs.version }}-${{ matrix.config.short_name }}.zip + release_name: "ifcconvert-${{steps.version.outputs.version}}" + tag: "ifcconvert-${{steps.version.outputs.version}}" + overwrite: true diff --git a/src/ifcopenshell-python/Makefile b/src/ifcopenshell-python/Makefile index 1ff713240d..c76a6fddb9 100644 --- a/src/ifcopenshell-python/Makefile +++ b/src/ifcopenshell-python/Makefile @@ -90,6 +90,15 @@ coverage: clean: rm -rf htmlcov +.PHONY: zip-ifcconvert +zip-ifcconvert: +ifndef PLATFORM + $(error PLATFORM is not set) +endif + mkdir -p dist + cd dist && wget $(IFCCONVERT_URL) + cd dist && mv *.zip ifcconvert-$(VERSION)-$(PLATFORM).zip + .PHONY: zip zip: ifndef PLATFORM @@ -139,4 +148,4 @@ ifeq ($(IS_STABLE), TRUE) else cp build/dist/ifcopenshell-*.whl dist/ifcopenshell-$(VERSION)a$(VERSION_DATE)-$(PYVERSION)-none-$(PLATFORMTAG).whl endif - # rm -rf build + rm -rf build