name: Binary Build # This workflow can be used to build a binary like pezkuwi + workers, omninode or pezkuwi-teyrchain # from any branch with release or profuction profile to be later used for testing. # ⚠️ IT should not be used for release purposes! on: workflow_dispatch: inputs: binary: required: true default: "pezkuwi" description: "The binary to build" package: description: Package to be built, can be pezkuwi, pezkuwi-teyrchain-bin, pezkuwi-omni-node etc. required: true type: string profile: required: true default: "release" description: "The profile to use for the binary build" features: required: false type: string description: "Features to enable when building the binary (must be a list of comma-separated features)" jobs: setup: # GitHub Actions allows using 'env' in a container context. # However, env variables don't work for forks: https://github.com/orgs/community/discussions/44322 # This workaround sets the container image for each job using 'set-image' job output. runs-on: ubuntu-latest outputs: IMAGE: ${{ steps.set_image.outputs.IMAGE }} RUNNER: ${{ steps.set_runner.outputs.RUNNER }} steps: - name: Checkout uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - name: Set image id: set_image run: cat .github/env >> $GITHUB_OUTPUT - name: Set runner id: set_runner shell: bash run: | if [[ "${{ inputs.binary }}" == "pezkuwi-teyrchain" ]]; then echo "RUNNER=pezkuwichain-large" >> $GITHUB_OUTPUT else echo "RUNNER=ubuntu-latest" >> $GITHUB_OUTPUT fi build: needs: [setup] runs-on: ${{ needs.setup.outputs.RUNNER }} container: image: ${{ needs.setup.outputs.IMAGE }} steps: - name: Checkout uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - name: Build binary run: | git config --global --add safe.directory "${GITHUB_WORKSPACE}" #avoid "detected dubious ownership" error PROFILE=${{ inputs.profile }} if [ "${{ inputs.binary }}" = "pezkuwi" ]; then for binary in pezkuwi pezkuwi-prepare-worker pezkuwi-execute-worker; do echo "Building $binary with profile $PROFILE and features ${{ inputs.features }}" ./.github/scripts/release/build-linux-release.sh $binary ${{ inputs.package }} ${{ inputs.features }} done else echo "Building ${{ inputs.binary }} with profile $PROFILE and features ${{ inputs.features }}" ./.github/scripts/release/build-linux-release.sh ${{ inputs.binary }} ${{ inputs.package }} ${{ inputs.features }} fi - name: Upload ${{ inputs.binary }} artifacts uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 with: name: ${{ inputs.binary }} path: /artifacts/**