Skip to content

Commit

Permalink
release: build and release macos arm64
Browse files Browse the repository at this point in the history
  • Loading branch information
devmatteini committed Dec 9, 2023
1 parent 35e6a55 commit 57cbb74
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ jobs:
runner: macos-latest
target: x86_64-apple-darwin
use-cross: false
- os: macos-arm64
runner: macos-latest
target: aarch64-apple-darwin
use-cross: false
- os: windows
runner: windows-latest
target: x86_64-pc-windows-msvc
Expand Down
7 changes: 4 additions & 3 deletions scripts/create-release-archive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ LINUX_MUSL="linux-musl"
LINUX_ARMV6="linux-armv6"
LINUX_ARM64="linux-arm64"
MACOS="macos"
MACOS_ARM64="macos-arm64"
WINDOWS="windows"

function usage() {
Expand All @@ -15,13 +16,13 @@ function usage() {
echo
echo "ARGS:"
echo " <version> version using format x.y.z"
echo " <os> supported os: $LINUX, $MACOS, $WINDOWS, $LINUX_ARMV6, $LINUX_ARM64, $LINUX_MUSL"
echo " <os> supported os: $LINUX, $MACOS, $WINDOWS, $LINUX_ARMV6, $LINUX_ARM64, $LINUX_MUSL, $MACOS_ARM64"
echo " <target> build target name (https://doc.rust-lang.org/rustc/platform-support.html)"
exit 1
}

function is_supported_os() {
if [[ "$1" != "$LINUX" && "$1" != "$MACOS" && "$1" != "$WINDOWS" && "$1" != "$LINUX_ARMV6" && "$1" != "$LINUX_ARM64" && "$1" != "$LINUX_MUSL" ]]; then
if [[ "$1" != "$LINUX" && "$1" != "$MACOS" && "$1" != "$WINDOWS" && "$1" != "$LINUX_ARMV6" && "$1" != "$LINUX_ARM64" && "$1" != "$LINUX_MUSL" && "$1" != "$MACOS_ARM64" ]]; then
echo "Error: '$1' is not valid os"
return 1
fi
Expand All @@ -30,7 +31,7 @@ function is_supported_os() {
# Arguments:
# $1 = os; $2 = file to strip
function strip_executable() {
if [[ "$1" == "$LINUX" || "$1" == "$LINUX_MUSL" || "$1" == "$MACOS" ]]; then
if [[ "$1" == "$LINUX" || "$1" == "$LINUX_MUSL" || "$1" == "$MACOS" || "$1" == "$MACOS_ARM64" ]]; then
strip "$2"
elif [[ "$1" == "$LINUX_ARMV6" ]]; then
arm-linux-gnueabihf-strip "$2"
Expand Down

0 comments on commit 57cbb74

Please sign in to comment.