Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ci): publish ARM macOS builds #22140

Merged
merged 12 commits into from
Jan 8, 2025
66 changes: 53 additions & 13 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -266,16 +266,32 @@ jobs:
name: vector-${{ env.VECTOR_VERSION }}-arm-unknown-linux-musleabi
path: target/artifacts/vector*

build-x86_64-apple-darwin-packages:
name: Build Vector for x86_64-apple-darwin (.tar.gz)
runs-on: macos-latest-large
build-apple-darwin-packages:
name: Build Vector for Apple Darwin (.tar.gz)
pront marked this conversation as resolved.
Show resolved Hide resolved
runs-on: ${{ matrix.runner }}
timeout-minutes: 90
needs: generate-publish-metadata
env:
VECTOR_VERSION: ${{ needs.generate-publish-metadata.outputs.vector_version }}
VECTOR_BUILD_DESC: ${{ needs.generate-publish-metadata.outputs.vector_build_desc }}
CHANNEL: ${{ needs.generate-publish-metadata.outputs.vector_release_channel }}
strategy:
matrix:
include:
# Refer to https://docs.github.com/en/actions/using-github-hosted-runners/using-larger-runners/about-larger-runners#about-macos-larger-runners.
- architecture: x86_64
runner: macos-latest-large
- architecture: arm64
runner: macos-latest-xlarge
steps:
- name: Verify Runner Architecture
pront marked this conversation as resolved.
Show resolved Hide resolved
run: |
ARCH=$(uname -m)
echo "Detected architecture: $ARCH"
if [ "$ARCH" != "${{ matrix.architecture }}" ]; then
echo "Error: Expected ${{ matrix.architecture }} architecture, but got $ARCH!"
exit 1
fi
- name: Checkout Vector
uses: actions/checkout@v4
with:
pront marked this conversation as resolved.
Show resolved Hide resolved
Expand All @@ -284,17 +300,18 @@ jobs:
run: bash scripts/environment/bootstrap-macos.sh
- name: Build Vector
env:
TARGET: "x86_64-apple-darwin"
TARGET: "${{ matrix.architecture }}-apple-darwin"
NATIVE_BUILD: true
run: |
export PATH="$HOME/.cargo/bin:$PATH"
make package
- name: Stage package artifacts for publish
uses: actions/upload-artifact@v4
with:
name: vector-${{ env.VECTOR_VERSION }}-x86_64-apple-darwin
name: vector-${{ env.VECTOR_VERSION }}-${{ matrix.architecture }}-apple-darwin
path: target/artifacts/vector*


build-x86_64-pc-windows-msvc-packages:
name: Build Vector for x86_64-pc-windows-msvc (.zip)
runs-on: release-builder-windows-2022
Expand Down Expand Up @@ -443,26 +460,34 @@ jobs:

macos-verify:
name: Verify macOS Package
runs-on: macos-latest-large
runs-on: ${{ matrix.runner }}
timeout-minutes: 5
needs:
- generate-publish-metadata
- build-x86_64-apple-darwin-packages
- build-apple-darwin-packages
env:
VECTOR_VERSION: ${{ needs.generate-publish-metadata.outputs.vector_version }}
strategy:
matrix:
include:
- target: x86_64-apple-darwin
runner: macos-latest-large
- target: arm64-apple-darwin
runner: macos-latest-xlarge
steps:
- name: Checkout Vector
uses: actions/checkout@v4
with:
ref: ${{ inputs.git_ref }}
- name: Download staged package artifacts (x86_64-apple-darwin)
- name: Download staged package artifacts (${{ matrix.target }})
uses: actions/download-artifact@v4
with:
name: vector-${{ env.VECTOR_VERSION }}-x86_64-apple-darwin
name: vector-${{ env.VECTOR_VERSION }}-${{ matrix.target }}
path: target/artifacts
- name: Verify macOS package
run: |
tar -xvf target/artifacts/vector-${{ env.VECTOR_VERSION }}-x86_64-apple-darwin.tar.gz && vector-x86_64-apple-darwin/bin/vector --version
tar -xvf target/artifacts/vector-${{ env.VECTOR_VERSION }}-${{ matrix.target }}.tar.gz \
&& vector-${{ matrix.target }}/bin/vector --version

publish-docker:
name: Publish to Docker
Expand Down Expand Up @@ -563,7 +588,7 @@ jobs:
- build-x86_64-unknown-linux-musl-packages
- build-aarch64-unknown-linux-musl-packages
- build-aarch64-unknown-linux-gnu-packages
- build-x86_64-apple-darwin-packages
- build-apple-darwin-packages
- build-x86_64-pc-windows-msvc-packages
- build-armv7-unknown-linux-musleabihf-packages
- build-armv7-unknown-linux-gnueabihf-packages
Expand Down Expand Up @@ -605,6 +630,11 @@ jobs:
with:
name: vector-${{ env.VECTOR_VERSION }}-x86_64-apple-darwin
path: target/artifacts
- name: Download staged package artifacts (arm64-apple-darwin)
Copy link
Member Author

@pront pront Jan 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: All these jobs are repetitive. They would benefit from a download-artifacts job. But that is too big of change for this PR. I will follow-up in another PR.

uses: actions/download-artifact@v4
with:
name: vector-${{ env.VECTOR_VERSION }}-arm64-apple-darwin
path: target/artifacts
- name: Download staged package artifacts (x86_64-pc-windows-msvc)
uses: actions/download-artifact@v4
with:
Expand Down Expand Up @@ -648,7 +678,7 @@ jobs:
- build-x86_64-unknown-linux-musl-packages
- build-aarch64-unknown-linux-musl-packages
- build-aarch64-unknown-linux-gnu-packages
- build-x86_64-apple-darwin-packages
- build-apple-darwin-packages
- build-x86_64-pc-windows-msvc-packages
- build-armv7-unknown-linux-gnueabihf-packages
- build-armv7-unknown-linux-musleabihf-packages
Expand Down Expand Up @@ -690,6 +720,11 @@ jobs:
with:
name: vector-${{ env.VECTOR_VERSION }}-x86_64-apple-darwin
path: target/artifacts
- name: Download staged package artifacts (arm64-apple-darwin)
uses: actions/download-artifact@v4
with:
name: vector-${{ env.VECTOR_VERSION }}-arm64-apple-darwin
path: target/artifacts
- name: Download staged package artifacts (x86_64-pc-windows-msvc)
uses: actions/download-artifact@v4
with:
Expand Down Expand Up @@ -756,7 +791,7 @@ jobs:
- build-x86_64-unknown-linux-musl-packages
- build-aarch64-unknown-linux-musl-packages
- build-aarch64-unknown-linux-gnu-packages
- build-x86_64-apple-darwin-packages
- build-apple-darwin-packages
- build-x86_64-pc-windows-msvc-packages
- build-armv7-unknown-linux-gnueabihf-packages
- build-armv7-unknown-linux-musleabihf-packages
Expand Down Expand Up @@ -794,6 +829,11 @@ jobs:
with:
name: vector-${{ env.VECTOR_VERSION }}-x86_64-apple-darwin
path: target/artifacts
- name: Download staged package artifacts (arm64-apple-darwin)
uses: actions/download-artifact@v4
with:
name: vector-${{ env.VECTOR_VERSION }}-arm64-apple-darwin
path: target/artifacts
- name: Download staged package artifacts (x86_64-pc-windows-msvc)
uses: actions/download-artifact@v4
with:
Expand Down
Loading