Skip to content

Build on Mac OS

Build on Mac OS #39039

Workflow file for this run

name: Build on Mac OS
run-name: Build on Mac OS
on:
merge_group:
paths:
- '.github/workflows/build-macos.yaml'
- '**.go'
- 'go.mod'
- 'go.sum'
- '**.rs'
- 'Cargo.toml'
- 'Cargo.lock'
- 'build.assets/Makefile'
- 'build.assets/Dockerfile*'
- 'Makefile'
jobs:
build:
name: Build on Mac OS
if: ${{ !startsWith(github.head_ref, 'dependabot/') }}
runs-on: macos-13-xl-arm64
permissions:
contents: read
steps:
# This is necessary on macos arm64 runners because the .cache and
# .config dirs on the runner are owned by root not the "runner" user.
- name: Fix home dir perms
run: sudo chown -R $(id -u):$(id -g) $HOME/.cache $HOME/.config
- name: Checkout Teleport
uses: actions/checkout@v4
- name: Determine Toolchain Versions and cache paths
run: |
echo NODE_VERSION=$(make -s -C build.assets print-node-version) >> $GITHUB_ENV
echo GOLANG_VERSION=$(make -s -C build.assets print-go-version | sed 's/^go//') >> $GITHUB_ENV
echo RUST_VERSION=$(make -s -C build.assets print-rust-version) >> $GITHUB_ENV
echo WASM_PACK_VERSION=$(make -s -C build.assets print-wasm-pack-version) >> $GITHUB_ENV
echo PKG_CONFIG_PATH="$(build.assets/build-fido2-macos.sh pkg_config_path)" >> $GITHUB_ENV
- name: Print versions
run: |
echo "make: $(make --version)"
echo "node: ${NODE_VERSION}"
echo "go: ${GOLANG_VERSION}"
echo "rust: ${RUST_VERSION}"
echo "wasm-pack: ${WASM_PACK_VERSION}"
- name: Install Node Toolchain
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Setup pnpm
run: |
corepack enable pnpm
- name: Install Go Toolchain
uses: actions/setup-go@v5
with:
cache: false
go-version: ${{ env.GOLANG_VERSION }}
- name: Configure Rust Toolchain
run: |
rustup override set ${{ env.RUST_VERSION }}
- name: Install wasm-pack
run: |
cargo install wasm-pack --locked --version ${WASM_PACK_VERSION}
- name: Build
run: make binaries