--- name: _prepare on: workflow_call: inputs: builder_ref: description: Git ref to checkout of build-emacs-for-macos required: false type: string default: "" outputs: builder_ref: description: Git ref of build-emacs-for-macos at builder_ref value: ${{ jobs.builder-sha.outputs.ref }} builder_sha: description: Git commit SHA of build-emacs-for-macos at builder_ref value: ${{ jobs.builder-sha.outputs.sha }} jobs: builder-sha: runs-on: "macos-13" outputs: ref: ${{ steps.ref.outputs.ref }} sha: ${{ steps.sha.outputs.sha }} steps: - name: Default git ref check id: ref run: | DEFAULT_BUILDER_REF="v0.6.60" BUILDER_REF="${{ inputs.builder_ref }}" echo "ref=${BUILDER_REF:-$DEFAULT_BUILDER_REF}" >> "$GITHUB_OUTPUT" - name: Checkout build-emacs-for-macos repo uses: actions/checkout@v4 with: repository: jimeh/build-emacs-for-macos ref: ${{ steps.ref.outputs.ref }} - name: Store builder Git SHA id: sha run: | BUILDER_SHA="$(git rev-parse HEAD)" echo "$BUILDER_SHA" > build-emacs-for-macos-git-sha.txt echo "sha=$BUILDER_SHA" >> "$GITHUB_OUTPUT" echo "Builder ref ${{ inputs.builder_ref }} resolved to" \ "commit SHA: $BUILDER_SHA" - name: Upload builder git SHA artifact uses: actions/upload-artifact@v4 with: name: build-emacs-for-macos-git-sha path: build-emacs-for-macos-git-sha.txt if-no-files-found: error emacs-builder: needs: [builder-sha] strategy: matrix: os: - macos-13 # Only macos-13 and earlier are x86_64. - macos-14 # Only macos-14 and later are ARM64. runs-on: ${{ matrix.os }} steps: - name: Cache emacs-builder (${{ runner.arch }}) id: cache uses: actions/cache@v4 with: path: bin/emacs-builder key: emacs-builder-${{ runner.arch }}-${{ needs.builder-sha.outputs.sha }}-bin - name: Checkout build-emacs-for-macos repo if: steps.cache.outputs.cache-hit != 'true' uses: actions/checkout@v4 with: repository: jimeh/build-emacs-for-macos ref: ${{ needs.builder-sha.outputs.ref }} fetch-depth: 0 - name: Setup Go if: steps.cache.outputs.cache-hit != 'true' uses: actions/setup-go@v5 with: go-version: "1.23" - name: Build emacs-builder tool if: steps.cache.outputs.cache-hit != 'true' run: make build - name: Ensure emacs-builder is executable if: steps.cache.outputs.cache-hit != 'true' run: chmod +x bin/emacs-builder - run: bin/emacs-builder --version - name: Upload emacs-builder artifact uses: actions/upload-artifact@v4 with: name: emacs-builder-${{ runner.arch }} path: bin/emacs-builder if-no-files-found: error