Generate console app on Windows and mac #23
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will install Python dependencies, run tests and lint with a single version of Python | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python | |
name: Python application | |
on: | |
push: | |
branches: | |
- code-sign | |
# tags: | |
# - '*' | |
permissions: | |
contents: read | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ windows-latest, ubuntu-20.04, macos-latest ] | |
include: | |
- os: windows-latest | |
artifact_name: cityjson2ifc-win | |
- os: ubuntu-20.04 | |
artifact_name: cityjson2ifc-ubuntu | |
- os: macos-latest | |
artifact_name: cityjson2ifc-macos | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.10" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install pytest tox pyinstaller | |
- if: runner.os == 'Windows' | |
run: | | |
git config --system core.longpaths true | |
- name: Test with tox | |
run: | | |
tox | |
- name: Install package | |
run: pip install . | |
- if: runner.os == 'Linux' | |
name: Pyinstaller package Linux | |
run: | | |
pyinstaller \ | |
--name cityjson2ifc \ | |
--onefile \ | |
--collect-all ifcopenshell src/cityjson2ifc_cli/cli.py | |
zip -rj dist/cityjson2ifc-ubuntu.zip dist/cityjson2ifc | |
sha256sum dist/cityjson2ifc-ubuntu.zip > dist/cityjson2ifc-ubuntu.zip.sha256sum | |
rm dist/cityjson2ifc | |
- if: runner.os == 'macOS' | |
name: Pyinstaller package macOS | |
run: | | |
pyinstaller \ | |
--name cityjson2ifc \ | |
--onefile \ | |
--console \ | |
--collect-all ifcopenshell src/cityjson2ifc_cli/cli.py | |
zip -rj dist/cityjson2ifc-macos.zip dist/cityjson2ifc | |
shasum -a 256 dist/cityjson2ifc-macos.zip > dist/cityjson2ifc-macos.zip.sha256sum | |
rm dist/cityjson2ifc | |
- if: runner.os == 'Windows' | |
name: Pyinstaller package Windows | |
run: | | |
pyinstaller --name cityjson2ifc --onefile --console --collect-all ifcopenshell src/cityjson2ifc_cli/cli.py | |
certUtil -hashfile dist/cityjson2ifc.exe SHA256 > dist/cityjson2ifc.exe.sha256sum | |
- name: List contents | |
run: | | |
ls dist | |
- name: Upload binaries to | |
uses: actions/upload-artifact@v3 | |
with: | |
name: cityjson2ifc | |
path: dist/* | |
retention-days: 1 | |
# - name: Upload binaries to release | |
# uses: svenstaro/upload-release-action@v2 | |
# with: | |
# repo_token: ${{ secrets.GH_PAT }} | |
# file: dist/* | |
# tag: ${{ github.ref }} | |
# overwrite: true | |
# file_glob: true |