mirror of
https://github.com/jimeh/emacs-builds.git
synced 2026-02-19 06:06:41 +00:00
Allow the default builder_ref to be set in the a single location, the _prepare shared workflow. Other workflows essentially have a override option, and no longer need explicit default values set.
146 lines
4.8 KiB
YAML
146 lines
4.8 KiB
YAML
---
|
|
name: _build
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
git_ref:
|
|
description: Emacs git ref to build
|
|
required: true
|
|
type: string
|
|
git_sha:
|
|
description: Override Emacs git commit SHA to build
|
|
required: false
|
|
type: string
|
|
builder_ref:
|
|
description: "Git ref to checkout of build-emacs-for-macos"
|
|
required: false
|
|
type: string
|
|
builder_args:
|
|
description: Custom arguments passed to build script
|
|
required: false
|
|
default: ""
|
|
type: string
|
|
test_build_name:
|
|
description: "Test build name"
|
|
required: false
|
|
default: ""
|
|
type: string
|
|
test_release_type:
|
|
description: "prerelease or draft"
|
|
required: false
|
|
default: ""
|
|
type: string
|
|
x86_64:
|
|
description: "Build x86_64 version of Emacs"
|
|
required: false
|
|
default: true
|
|
type: boolean
|
|
arm64:
|
|
description: "Build arm64 version of Emacs"
|
|
required: false
|
|
default: true
|
|
type: boolean
|
|
|
|
jobs:
|
|
prepare:
|
|
name: Prepare
|
|
uses: ./.github/workflows/_prepare.yml
|
|
with:
|
|
builder_ref: ${{ inputs.builder_ref }}
|
|
|
|
# ----------------------------------------------------------------------------
|
|
# Build x86_64 version of Emacs
|
|
# ----------------------------------------------------------------------------
|
|
|
|
build_x86_64:
|
|
name: Build (x86_64)
|
|
if: inputs.x86_64
|
|
uses: ./.github/workflows/_build_emacs.yml
|
|
needs: [prepare]
|
|
with:
|
|
builder_ref: ${{ needs.prepare.outputs.builder_sha }}
|
|
os: "macos-13"
|
|
build_os: "macos-13" # Only macos-13 and earlier are x86_64.
|
|
artifact_prefix: "x86_64-"
|
|
git_ref: ${{ inputs.git_ref }}
|
|
git_sha: ${{ inputs.git_sha }}
|
|
build_args: ${{ inputs.builder_args }}
|
|
test_build_name: ${{ inputs.test_build_name }}
|
|
test_release_type: ${{ inputs.test_release_type }}
|
|
secrets: inherit
|
|
|
|
release_x86_64:
|
|
name: Release (x86_64)
|
|
uses: ./.github/workflows/_release.yml
|
|
# Depend on both build_x86_64 and build_arm64, but only run if build_x86_64
|
|
# was successful and a package was created. This ensure wait for all builds
|
|
# to complete before running any release jobs.
|
|
needs: [prepare, build_x86_64, build_arm64]
|
|
if: |
|
|
always() &&
|
|
needs.build_x86_64.result == 'success' &&
|
|
needs.build_x86_64.outputs.package_created &&
|
|
needs.build_arm64.result != 'failure'
|
|
with:
|
|
builder_ref: ${{ needs.prepare.outputs.builder_sha }}
|
|
os: "macos-13" # Only macos-13 and earlier are x86_64.
|
|
plan_artifact: x86_64-build-plan
|
|
dmg_artifact: x86_64-dmg
|
|
|
|
# ----------------------------------------------------------------------------
|
|
# Build arm64 version of Emacs
|
|
# ----------------------------------------------------------------------------
|
|
|
|
build_arm64:
|
|
name: Build (arm64)
|
|
if: inputs.arm64
|
|
uses: ./.github/workflows/_build_emacs.yml
|
|
needs: [prepare]
|
|
with:
|
|
builder_ref: ${{ needs.prepare.outputs.builder_sha }}
|
|
os: "macos-14"
|
|
build_os: "macos-14" # Only macos-14 and later are ARM64.
|
|
artifact_prefix: "arm64-"
|
|
git_ref: ${{ inputs.git_ref }}
|
|
git_sha: ${{ inputs.git_sha }}
|
|
build_args: ${{ inputs.builder_args }}
|
|
test_build_name: ${{ inputs.test_build_name }}
|
|
test_release_type: ${{ inputs.test_release_type }}
|
|
secrets: inherit
|
|
|
|
release_arm64:
|
|
name: Release (arm64)
|
|
uses: ./.github/workflows/_release.yml
|
|
# Depend on both build_arm64 and build_x86_64, but only run if build_arm64
|
|
# was successful and a package was created. This ensure wait for all builds
|
|
# to complete before running any release jobs.
|
|
needs: [prepare, build_arm64, build_x86_64]
|
|
if: |
|
|
always() &&
|
|
needs.build_arm64.result == 'success' &&
|
|
needs.build_arm64.outputs.package_created &&
|
|
needs.build_x86_64.result != 'failure'
|
|
with:
|
|
builder_ref: ${{ needs.prepare.outputs.builder_sha }}
|
|
os: "macos-14" # Only macos-14 and later are ARM64.
|
|
plan_artifact: arm64-build-plan
|
|
dmg_artifact: arm64-dmg
|
|
|
|
# ----------------------------------------------------------------------------
|
|
# Trigger update casks workflow in homebrew tap
|
|
# ----------------------------------------------------------------------------
|
|
|
|
update_casks:
|
|
name: Update Casks
|
|
uses: ./.github/workflows/_update-casks.yml
|
|
# Depend on both release jobs, but only run if either of them was
|
|
# successful. This ensures we only run this job once all release jobs have
|
|
# been completed.
|
|
needs: [release_x86_64, release_arm64]
|
|
if: >-
|
|
always() &&
|
|
inputs.test_build_name == '' &&
|
|
contains(needs.*.result, 'success') &&
|
|
!contains(needs.*.result, 'failure')
|
|
secrets: inherit
|