From 40c7b2b76a509cb6e8623cce29b4a563f440b0b9 Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Sun, 19 Nov 2023 00:05:04 +0000 Subject: [PATCH] feat(build): allow running build job on separate OS This should help reduce costs for Apple Silicon builds, as they are not available on any form of free tier of GitHub Actions at the moment. The build step that actually runs Emacs' configure script, and compiles Emacs, is the only step that actually needs to run on the target hardware architecture. The rest should be architecture agnostic. --- .github/workflows/_build.yml | 11 +++++++++-- .github/workflows/_prepare.yml | 3 ++- .github/workflows/_release.yml | 3 ++- .github/workflows/build.yml | 5 +++++ 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/.github/workflows/_build.yml b/.github/workflows/_build.yml index c15d291..b532e15 100644 --- a/.github/workflows/_build.yml +++ b/.github/workflows/_build.yml @@ -11,7 +11,13 @@ on: os: description: GitHub Actions runner OS type: string - required: true + required: false + default: "macos-11" + build_os: + description: Target OS to build for + type: string + required: false + default: "macos-11" git_ref: description: Git ref to build type: string @@ -127,7 +133,7 @@ jobs: if: ${{ steps.check.outputs.result == 'fail' }} build: - runs-on: ${{ inputs.os }} + runs-on: ${{ inputs.build_os }} needs: [prepare, plan] # Only run if check for existing release and asset failed. if: ${{ needs.plan.outputs.check == 'fail' }} @@ -162,6 +168,7 @@ jobs: --log-level debug --plan build-plan.yml --native-full-aot + --no-self-sign ${{ inputs.build_args }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/_prepare.yml b/.github/workflows/_prepare.yml index 7f844ab..9ff409f 100644 --- a/.github/workflows/_prepare.yml +++ b/.github/workflows/_prepare.yml @@ -6,7 +6,8 @@ on: os: description: GitHub Actions runner OS type: string - required: true + required: false + default: "macos-11" builder_ref: description: Git ref to checkout of build-emacs-for-macos required: false diff --git a/.github/workflows/_release.yml b/.github/workflows/_release.yml index 385b63c..da2e0e9 100644 --- a/.github/workflows/_release.yml +++ b/.github/workflows/_release.yml @@ -7,7 +7,8 @@ on: os: description: GitHub Actions runner OS type: string - required: true + required: false + default: "macos-11" plan_artifact: description: Name of artifact containing a emacs-builder plan yaml file type: string diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c99d5af..7472117 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,6 +22,10 @@ on: description: 'Runner OS ("macos-11", "macos-12", or "macos-latest")' required: true default: "macos-11" + build_os: + description: "Build OS used to build Emacs" + required: false + default: "macos-11" test_build_name: description: "Test build name" required: false @@ -47,6 +51,7 @@ jobs: uses: ./.github/workflows/_build.yml with: os: ${{ github.event.inputs.os }} + build_os: ${{ github.event.inputs.build_os }} git_ref: ${{ github.event.inputs.git_ref }} git_sha: ${{ github.event.inputs.git_sha }} build_args: ${{ github.event.inputs.builder_args }}