Build MPC with nearcore branch #273
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: Build MPC with nearcore branch | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| nearcore-branch: | |
| default: "master" | |
| description: "nearcore git branch to use for mpc build" | |
| type: string | |
| required: true | |
| schedule: | |
| - cron: '0 1 * * *' # Nightly at 1:00 UTC (every day) | |
| jobs: | |
| build-mpc: | |
| runs-on: warp-ubuntu-2404-x64-8x | |
| environment: production | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: Adjust Cargo.toml to use required nearcore branch | |
| env: | |
| NEARCORE_BRANCH: ${{ inputs.nearcore-branch || 'master' }} | |
| run: | | |
| sed -i -E "s#(\{ git = \"https://github.com/near/nearcore\", )(tag|branch) = \"[^\"]*\"#\1branch = \"${NEARCORE_BRANCH}\"#g" Cargo.toml | |
| - name: Build MPC | |
| id: build-mpc | |
| run: cargo build -p mpc-node | |
| - name: Failure Slack Notification | |
| if: failure() | |
| env: | |
| SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} | |
| uses: act10ns/slack@d96404edccc6d6467fc7f8134a420c851b1e9054 # v2.2.0 | |
| with: | |
| status: failure | |
| message: "MPC build failed with latest nearcore branch: ${{ inputs.nearcore-branch || 'master' }}. Check the logs <https://github.com/near/mpc/actions/runs/${{ github.run_id }}|here> " | |