Configurator #6
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: Configurator | |
| on: | |
| workflow_run: | |
| workflows: ["Firmware"] | |
| types: | |
| - completed | |
| jobs: | |
| windows: | |
| runs-on: windows-latest | |
| if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Install Python dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install pillow | |
| - name: Download firmware artifact from workflow | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| run_id: context.payload.workflow_run.id, | |
| }); | |
| let matchArtifact = allArtifacts.data.artifacts.filter((artifact) => { | |
| return artifact.name == "firmware-windows" | |
| })[0]; | |
| let download = await github.rest.actions.downloadArtifact({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| artifact_id: matchArtifact.id, | |
| archive_format: 'zip', | |
| }); | |
| let fs = require('fs'); | |
| fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/firmware-windows.zip`, Buffer.from(download.data)); | |
| - name: Extract firmware artifact | |
| run: | | |
| Expand-Archive -Path firmware-windows.zip -DestinationPath build/dist | |
| Remove-Item firmware-windows.zip | |
| - name: Setup build environment and build configurator | |
| run: | | |
| cd build | |
| cmake -S .. -B . -G Ninja -DBUILD_TOOLS_FROM_SOURCE=ON -DCONFIGURATOR_ONLY=ON | |
| cmake --build . --target configurator_all | |
| - name: Upload Configurator Artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: configurator-windows | |
| path: | | |
| build/dist/*.rom | |
| build/dist/*.bin | |
| build/dist/*.nabu | |
| build/dist/*.npz | |
| linux: | |
| runs-on: ubuntu-latest | |
| if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Download firmware artifact from workflow | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| run_id: context.payload.workflow_run.id, | |
| }); | |
| let matchArtifact = allArtifacts.data.artifacts.filter((artifact) => { | |
| return artifact.name == "firmware-linux" | |
| })[0]; | |
| let download = await github.rest.actions.downloadArtifact({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| artifact_id: matchArtifact.id, | |
| archive_format: 'zip', | |
| }); | |
| let fs = require('fs'); | |
| fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/firmware-linux.zip`, Buffer.from(download.data)); | |
| - name: Extract firmware artifact | |
| run: | | |
| mkdir -p build/dist | |
| unzip firmware-linux.zip -d build/dist | |
| rm firmware-linux.zip | |
| - name: Setup build environment and build configurator | |
| run: | | |
| cd build | |
| cmake -S .. -B . -G Ninja -DBUILD_TOOLS_FROM_SOURCE=ON -DCONFIGURATOR_ONLY=ON | |
| cmake --build . --target configurator_all | |
| - name: Upload Configurator Artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: configurator-linux | |
| path: | | |
| build/dist/*.rom | |
| build/dist/*.bin | |
| build/dist/*.nabu | |
| build/dist/*.npz |