From 9907babe8f0ca41262b56595fb6841a16f5ed7e6 Mon Sep 17 00:00:00 2001 From: Noemi <45180344+unflxw@users.noreply.github.com> Date: Thu, 21 Nov 2024 13:15:34 +0100 Subject: [PATCH] Release macOS builds Add macOS builds for Apple Silicon and Intel to the release process. --- .changesets/release-macos-builds.md | 8 ++++++++ .github/workflows/publish_release.yaml | 2 ++ README.md | 2 +- install.sh | 23 +++++++++++++---------- script/build_artifacts | 2 ++ 5 files changed, 26 insertions(+), 11 deletions(-) create mode 100644 .changesets/release-macos-builds.md diff --git a/.changesets/release-macos-builds.md b/.changesets/release-macos-builds.md new file mode 100644 index 0000000..feff41e --- /dev/null +++ b/.changesets/release-macos-builds.md @@ -0,0 +1,8 @@ +--- +bump: patch +type: add +--- + +Release macOS builds for Apple Silicon (arm64) and Intel (x86_64). + +Using these builds is discouraged in production environments. diff --git a/.github/workflows/publish_release.yaml b/.github/workflows/publish_release.yaml index 43f4257..e3e0ed2 100644 --- a/.github/workflows/publish_release.yaml +++ b/.github/workflows/publish_release.yaml @@ -71,6 +71,8 @@ jobs: 'release/x86_64-unknown-linux-musl.tar.gz#Linux (x86_64, musl)' \ 'release/aarch64-unknown-linux-gnu.tar.gz#Linux (arm64)' \ 'release/aarch64-unknown-linux-musl.tar.gz#Linux (arm64, musl)' \ + 'release/x86_64-apple-darwin.tar.gz#macOS (x86_64)' \ + 'release/aarch64-apple-darwin.tar.gz#macOS (arm64)' \ 'release/install.sh#Installer script' env: GH_TOKEN: ${{github.token}} diff --git a/README.md b/README.md index acacaef..e0135e9 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ curl -sSL https://github.com/appsignal/appsignal-wrap/releases/latest/download/i You'll need to run it with super-user privileges -- if you're not running this as root, prefix it with `sudo`. -Currently, `appsignal-wrap` is only supported for Linux, in the x86_64 and ARM64 architectures. Linux distributions based on musl, such as Alpine, are also supported. +`appsignal-wrap` is only supported for Linux and macOS, in the x86_64 (Intel) and arm64 (Apple Silicon) architectures. Linux distributions based on musl, such as Alpine, are also supported. Not a fan of `curl | sh` one-liners? Download the binary for your operating system and architecture [from our latest release](https://github.com/appsignal/appsignal-wrap/releases/latest/). diff --git a/install.sh b/install.sh index aaca329..4bcf77f 100755 --- a/install.sh +++ b/install.sh @@ -12,6 +12,8 @@ if ! command -v tar >/dev/null; then exit 1 fi +# This value is automatically updated during the release process; +# see `script/write_version`. LAST_RELEASE="0.2.0" VERSION="${APPSIGNAL_WRAP_VERSION:-"$LAST_RELEASE"}" @@ -20,25 +22,21 @@ INSTALL_FOLDER="${APPSIGNAL_WRAP_INSTALL_FOLDER:-"/usr/local/bin"}" # Expected values are "linux" or "darwin". OS="$(uname -s | tr '[:upper:]' '[:lower:]')" -if [ "$OS" != "linux" ]; then - echo "Error: Unsupported OS: $OS" - exit 1 -fi - if [ "$OS" = "linux" ]; then OS_FRIENDLY="Linux" VENDOR="unknown" +elif [ "$OS" = "darwin" ]; then + OS_FRIENDLY="macOS" + VENDOR="apple" +else + echo "Error: Unsupported OS: $OS" + exit 1 fi # Expected values are "x86_64", "aarch64" or "arm64". ARCH="$(uname -m)" ARCH_FRIENDLY="$ARCH" -if [ "$ARCH" != "x86_64" ] && [ "$ARCH" != "arm64" ] && [ "$ARCH" != "aarch64" ]; then - echo "Error: Unsupported architecture: $ARCH" - exit 1 -fi - # Rename "arm64" to "aarch64" to match the naming convention used by the Rust # toolchain target triples. if [ "$ARCH" = "arm64" ]; then @@ -50,6 +48,11 @@ if [ "$ARCH" = "aarch64" ]; then ARCH_FRIENDLY="arm64" fi +if [ "$ARCH" != "x86_64" ] && [ "$ARCH" != "aarch64" ]; then + echo "Error: Unsupported architecture: $ARCH" + exit 1 +fi + EXTRA="" EXTRA_FRIENDLY="" diff --git a/script/build_artifacts b/script/build_artifacts index 41510f0..e2612b3 100755 --- a/script/build_artifacts +++ b/script/build_artifacts @@ -2,8 +2,10 @@ rm -rf release +script/build_artifact x86_64-apple-darwin script/build_artifact x86_64-unknown-linux-gnu script/build_artifact x86_64-unknown-linux-musl +script/build_artifact aarch64-apple-darwin script/build_artifact aarch64-unknown-linux-gnu script/build_artifact aarch64-unknown-linux-musl