[tmp] #13
This file contains hidden or 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
| name: Publish IFC4.3 Output 2 | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| - master | |
| - xmi-refresh | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: publish-ifc43-output-2 | |
| cancel-in-progress: false | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-22.04 | |
| timeout-minutes: 120 | |
| env: | |
| REPO_DIR: ${{ github.workspace }}/ifc43 | |
| TRANSLATIONS_SRC_DIR: ${{ github.workspace }}/translations/translations | |
| TRANSLATIONS_BUILD_DIR: ${{ github.workspace }}/translations-build | |
| PO_HASH_PATH: ${{ github.workspace }}/translations-build/po_hash_map.json | |
| TARGET_SITE_DIR: ${{ github.workspace }}/output-repo/IFC/RELEASE/IFC4_3 | |
| PYTHONUNBUFFERED: "1" | |
| steps: | |
| - name: Check out source repository | |
| uses: actions/checkout@v4 | |
| with: | |
| path: ifc43 | |
| fetch-depth: 1 | |
| - name: Check out sample models | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: buildingSMART/IFC4.3.x-sample-models | |
| path: examples | |
| fetch-depth: 1 | |
| - name: Check out translations | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: buildingSMART/IFC4.3.x-output | |
| ref: translations | |
| path: translations | |
| fetch-depth: 1 | |
| - name: Check out output repository | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: buildingSMART/IFC4.3.x-output-2 | |
| path: output-repo | |
| fetch-depth: 1 | |
| token: ${{ secrets.OUTPUT_2_TOKEN }} | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.10" | |
| cache: pip | |
| cache-dependency-path: ifc43/code/requirements.txt | |
| - name: Install system dependencies | |
| shell: bash | |
| run: | | |
| set -euxo pipefail | |
| sudo apt-get update | |
| sudo apt-get install -y graphviz rsync unzip | |
| - name: Install Python dependencies | |
| shell: bash | |
| run: | | |
| set -euxo pipefail | |
| python -m pip install --upgrade pip | |
| python -m pip install -r ifc43/code/requirements.txt nltk reversestem | |
| - name: Install IfcOpenShell | |
| shell: bash | |
| run: | | |
| set -euxo pipefail | |
| pyver="$(python - <<'PY' | |
| import sys | |
| print(f"{sys.version_info.major}{sys.version_info.minor}") | |
| PY | |
| )" | |
| site_dir="$(python - <<'PY' | |
| import site | |
| print(site.getusersitepackages()) | |
| PY | |
| )" | |
| mkdir -p "$site_dir" | |
| curl --silent --show-error --retry 5 -L \ | |
| -o /tmp/ifcopenshell_python.zip \ | |
| "https://s3.amazonaws.com/ifcopenshell-builds/ifcopenshell-python-${pyver}-v0.7.0-476ab50-linux64.zip" | |
| unzip -o /tmp/ifcopenshell_python.zip -d "$site_dir" | |
| python - <<'PY' | |
| from ifcopenshell.express import express_parser | |
| print("IfcOpenShell import OK") | |
| PY | |
| - name: Generate EXPRESS and XSD | |
| working-directory: ifc43/code | |
| shell: bash | |
| run: | | |
| set -euxo pipefail | |
| python -m generators.express ../schemas/ifc4x3_add2.uml \ | |
| --output ../output/IFC.exp \ | |
| --with-xsd \ | |
| --xsd-output ../output/IFC.xsd | |
| - name: Generate property sets | |
| working-directory: ifc43/code | |
| shell: bash | |
| run: | | |
| set -euxo pipefail | |
| mkdir -p ../output/psd | |
| python -m generators.pset ../schemas/ifc4x3_add2.uml --output ../output/psd | |
| - name: Generate bSDD export | |
| working-directory: ifc43/code | |
| shell: bash | |
| run: | | |
| set -euxo pipefail | |
| python -m generators.bsdd ../schemas/ifc4x3_add2.uml --output ../output/bsdd | |
| - name: Generate JSON schema structure | |
| working-directory: ifc43/code | |
| shell: bash | |
| run: | | |
| set -euxo pipefail | |
| python -m generators.json ../schemas/ifc4x3_add2.uml ../output/psd --output ../output/structure.json | |
| - name: Build static HTML site | |
| working-directory: ifc43/code | |
| shell: bash | |
| run: | | |
| set -euxo pipefail | |
| python -m generators.html --output ../output/html -j 4 | |
| find "$REPO_DIR" -type d -maxdepth | |
| - name: Sync site into output repository | |
| shell: bash | |
| run: | | |
| set -euxo pipefail | |
| mkdir -p "$TARGET_SITE_DIR" | |
| rsync -a --delete "${GITHUB_WORKSPACE}/ifc43/output/html/" "${TARGET_SITE_DIR}/" | |
| - name: Commit and push output | |
| working-directory: output-repo | |
| shell: bash | |
| run: | | |
| set -euxo pipefail | |
| git config user.name "bSI-Bot" | |
| git config user.email ${{ secrets.BSI_BOT_EMAIL }} | |
| git add -A IFC/RELEASE/IFC4_3 | |
| if git diff --cached --quiet; then | |
| echo "No output changes to commit." | |
| exit 0 | |
| fi | |
| git commit -m "Update IFC4_3 output from ${GITHUB_REPOSITORY}@${GITHUB_SHA}" | |
| git push |