diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7a5753c..7212934 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,6 +16,10 @@ on: # We use 3.1.51 because later versions give compiler errors # (possibly related to https://github.com/emscripten-core/emscripten/issues/21128) default: '3.1.51' + make-branch: + type: boolean + default: false + pull_request: jobs: @@ -26,27 +30,29 @@ jobs: mfem-ref: ${{ github.event_name == 'pull_request' && 'master' || inputs.mfem-ref }} glvis-ref: ${{ github.event_name == 'pull_request' && 'master' || inputs.glvis-ref }} emscripten-version: ${{ github.event_name == 'pull_request' && '3.1.51' || inputs.emscripten-version }} + make-branch: ${{ github.event_name == 'workflow_dispatch' && inputs.make-branch }} name: >- build glvis-js | - mfem=${{ github.event_name == 'pull_request' && 'master' || inputs.mfem-ref }} | - glvis=${{ github.event_name == 'pull_request' && 'master' || inputs.glvis-ref }} | + mfem=${{ github.event_name == 'pull_request' && 'master' || inputs.mfem-ref }} | + glvis=${{ github.event_name == 'pull_request' && 'master' || inputs.glvis-ref }} | emcc=${{ github.event_name == 'pull_request' && '3.1.51' || inputs.emscripten-version }} steps: # --------------------------------------------------------------------------------- # Install glvis-js and dependencies # --------------------------------------------------------------------------------- + - name: Install glvis dependencies + run: | + sudo apt-get install libfontconfig1-dev libfreetype-dev libsdl2-dev \ + libglew-dev libglm-dev libpng-dev git-lfs + - name: Checkout glvis-js uses: actions/checkout@v4 with: submodules: recursive path: glvis-js - - - name: Install glvis dependencies - run: | - sudo apt-get install libfontconfig1-dev libfreetype-dev libsdl2-dev \ - libglew-dev libglm-dev libpng-dev + lfs: true - name: Checkout emscripten uses: actions/checkout@v4 @@ -77,7 +83,7 @@ jobs: path: glvis - name: Install glvis-js (also installs mfem + glvis) - run: | + run: | cd glvis-js make install -j 4 @@ -85,7 +91,7 @@ jobs: # Generate an artifact # --------------------------------------------------------------------------------- - name: Print artifact info - run: | + run: | cat glvis-js/src/versions.js sha256sum glvis-js/src/* @@ -95,3 +101,14 @@ jobs: name: glvis-js path: glvis-js/src retention-days: 1 + + - name: Push changes to a new branch + if: env.make-branch + run: | + cd glvis-js + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git switch -c "ci-build-${{ github.run_id }}" + git add . + git commit -m "Updating glvis-js build" + git push \ No newline at end of file