mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-11 10:06:47 +00:00
84 lines
2.5 KiB
YAML
84 lines
2.5 KiB
YAML
name: Build IfcOpenShell WASM / Pyodide
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build_ifcopenshell:
|
|
runs-on: ubuntu-22.04
|
|
|
|
steps:
|
|
- name: Checkout Repository
|
|
uses: actions/checkout@v3
|
|
with:
|
|
submodules: recursive
|
|
path: IfcOpenShell
|
|
|
|
- name: Checkout Pyodide
|
|
uses: actions/checkout@v3
|
|
with:
|
|
submodules: recursive
|
|
repository: pyodide/pyodide
|
|
ref: '0.28.0a3'
|
|
token: ${{ secrets.BUILD_REPO_TOKEN }}
|
|
path: pyodide
|
|
|
|
- name: Checkout Build Repository
|
|
uses: actions/checkout@v3
|
|
with:
|
|
repository: IfcOpenShell/build-outputs
|
|
path: ifcopenshell_build
|
|
ref: wasm
|
|
lfs: true
|
|
token: ${{ secrets.BUILD_REPO_TOKEN }}
|
|
|
|
- name: Unpack Dependencies
|
|
run: |
|
|
cd ifcopenshell_build
|
|
python ../IfcOpenShell/pyodide/cache_dependencies.py unpack
|
|
|
|
- name: Build
|
|
run: |
|
|
VERSION=`cat IfcOpenShell/VERSION`
|
|
sed -i s/0.8.0/$VERSION/g IfcOpenShell/pyodide/meta.yaml
|
|
sed -i s/--tty// pyodide/run_docker
|
|
pyodide/run_docker IfcOpenShell/pyodide/build_pyodide.sh
|
|
FILE=`echo dist/ifcopenshell-*.whl`
|
|
NEW_FILE=`echo $FILE | sed "s/$VERSION/$VERSION+${GITHUB_SHA:0:7}/"`
|
|
mv $FILE $NEW_FILE
|
|
|
|
- name: Upload Build Logs
|
|
if: always()
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: build-logs-pyodide
|
|
path: |
|
|
packages/ifcopenshell/build.log
|
|
ifcopenshell_build/*/*/logs/*.log
|
|
retention-days: 30
|
|
|
|
- name: Pack Dependencies
|
|
run: |
|
|
cd ifcopenshell_build
|
|
python ../IfcOpenShell/pyodide/cache_dependencies.py pack
|
|
|
|
- name: Commit and Push Changes to Build Repository
|
|
run: |
|
|
cd ifcopenshell_build
|
|
git config user.name "IfcOpenBot"
|
|
git config user.email "ifcopenbot@ifcopenshell.org"
|
|
git add */*/install/cache-*.tar.gz
|
|
git commit -m "Update build artifacts [skip ci]" || echo "No changes to commit"
|
|
git push || echo "Push failed"
|
|
|
|
- name: Configure AWS credentials
|
|
uses: aws-actions/configure-aws-credentials@v4
|
|
with:
|
|
aws-access-key-id: ${{ secrets.AWS_UPLOAD_ACCESS_KEY_ID }}
|
|
aws-secret-access-key: ${{ secrets.AWS_UPLOAD_SECRET_ACCESS_KEY }}
|
|
aws-region: us-east-1
|
|
|
|
- name: Upload .zip archives to S3
|
|
run: |
|
|
aws s3 cp dist s3://ifcopenshell-builds/ --recursive --exclude "*" --include "*.whl"
|