Add script to release a macOS static binary
Provide a prebuilt binary for macOS. Co-authored-by: Muvaffak Onus <me@muvaf.com>
This commit is contained in:
parent
2a72a7fb40
commit
4ef4838bf0
65
.github/workflows/release.yml
vendored
65
.github/workflows/release.yml
vendored
@ -163,6 +163,34 @@ jobs:
|
||||
name: build-win64-intermediate
|
||||
path: release/work/build-win64/dist-tar/
|
||||
|
||||
build-macos:
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
brew install meson ninja nasm libiconv zlib automake autoconf \
|
||||
libtool
|
||||
|
||||
- name: Build macOS
|
||||
run: release/build_macos.sh
|
||||
|
||||
# upload-artifact does not preserve permissions
|
||||
- name: Tar
|
||||
run: |
|
||||
cd release/work/build-macos
|
||||
mkdir dist-tar
|
||||
cd dist-tar
|
||||
tar -C .. -cvf dist.tar.gz dist/
|
||||
|
||||
- name: Upload build-macos artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: build-macos-intermediate
|
||||
path: release/work/build-macos/dist-tar/
|
||||
|
||||
package-linux:
|
||||
needs:
|
||||
- build-scrcpy-server
|
||||
@ -271,12 +299,49 @@ jobs:
|
||||
name: release-win64
|
||||
path: release/output
|
||||
|
||||
package-macos:
|
||||
needs:
|
||||
- build-scrcpy-server
|
||||
- build-macos
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Download scrcpy-server
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: scrcpy-server
|
||||
path: release/work/build-server/server/
|
||||
|
||||
- name: Download build-macos
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: build-macos-intermediate
|
||||
path: release/work/build-macos/dist-tar/
|
||||
|
||||
# upload-artifact does not preserve permissions
|
||||
- name: Detar
|
||||
run: |
|
||||
cd release/work/build-macos
|
||||
tar xf dist-tar/dist.tar.gz
|
||||
|
||||
- name: Package macos
|
||||
run: release/package_client.sh macos tar.gz
|
||||
|
||||
- name: Upload macos release
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: release-macos
|
||||
path: release/output/
|
||||
|
||||
release:
|
||||
needs:
|
||||
- build-scrcpy-server
|
||||
- package-linux
|
||||
- package-win32
|
||||
- package-win64
|
||||
- package-macos
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
|
29
app/deps/adb_macos.sh
Executable file
29
app/deps/adb_macos.sh
Executable file
@ -0,0 +1,29 @@
|
||||
#!/usr/bin/env bash
|
||||
set -ex
|
||||
DEPS_DIR=$(dirname ${BASH_SOURCE[0]})
|
||||
cd "$DEPS_DIR"
|
||||
. common
|
||||
|
||||
VERSION=35.0.2
|
||||
FILENAME=platform-tools_r$VERSION-darwin.zip
|
||||
PROJECT_DIR=platform-tools-$VERSION-darwin
|
||||
SHA256SUM=1820078db90bf21628d257ff052528af1c61bb48f754b3555648f5652fa35d78
|
||||
|
||||
cd "$SOURCES_DIR"
|
||||
|
||||
if [[ -d "$PROJECT_DIR" ]]
|
||||
then
|
||||
echo "$PWD/$PROJECT_DIR" found
|
||||
else
|
||||
get_file "https://dl.google.com/android/repository/$FILENAME" "$FILENAME" "$SHA256SUM"
|
||||
mkdir -p "$PROJECT_DIR"
|
||||
cd "$PROJECT_DIR"
|
||||
ZIP_PREFIX=platform-tools
|
||||
unzip "../$FILENAME" "$ZIP_PREFIX"/adb
|
||||
mv "$ZIP_PREFIX"/* .
|
||||
rmdir "$ZIP_PREFIX"
|
||||
fi
|
||||
|
||||
mkdir -p "$INSTALL_DIR/adb-macos"
|
||||
cd "$INSTALL_DIR/adb-macos"
|
||||
cp -r "$SOURCES_DIR/$PROJECT_DIR"/. "$INSTALL_DIR/adb-macos/"
|
35
release/build_macos.sh
Executable file
35
release/build_macos.sh
Executable file
@ -0,0 +1,35 @@
|
||||
#!/bin/bash
|
||||
set -ex
|
||||
cd "$(dirname ${BASH_SOURCE[0]})"
|
||||
. build_common
|
||||
cd .. # root project dir
|
||||
|
||||
MACOS_BUILD_DIR="$WORK_DIR/build-macos"
|
||||
|
||||
app/deps/adb_macos.sh
|
||||
app/deps/sdl.sh macos native static
|
||||
app/deps/ffmpeg.sh macos native static
|
||||
app/deps/libusb.sh macos native static
|
||||
|
||||
DEPS_INSTALL_DIR="$PWD/app/deps/work/install/macos-native-static"
|
||||
ADB_INSTALL_DIR="$PWD/app/deps/work/install/adb-macos"
|
||||
|
||||
rm -rf "$MACOS_BUILD_DIR"
|
||||
meson setup "$MACOS_BUILD_DIR" \
|
||||
--pkg-config-path="$DEPS_INSTALL_DIR/lib/pkgconfig" \
|
||||
-Dc_args="-I$DEPS_INSTALL_DIR/include" \
|
||||
-Dc_link_args="-L$DEPS_INSTALL_DIR/lib" \
|
||||
--buildtype=release \
|
||||
--strip \
|
||||
-Db_lto=true \
|
||||
-Dcompile_server=false \
|
||||
-Dportable=true \
|
||||
-Dstatic=true
|
||||
ninja -C "$MACOS_BUILD_DIR"
|
||||
|
||||
# Group intermediate outputs into a 'dist' directory
|
||||
mkdir -p "$MACOS_BUILD_DIR/dist"
|
||||
cp "$MACOS_BUILD_DIR"/app/scrcpy "$MACOS_BUILD_DIR/dist/scrcpy_bin"
|
||||
cp app/data/icon.png "$MACOS_BUILD_DIR/dist/"
|
||||
cp app/data/scrcpy_static_wrapper.sh "$MACOS_BUILD_DIR/dist/scrcpy"
|
||||
cp -r "$ADB_INSTALL_DIR"/. "$MACOS_BUILD_DIR/dist/"
|
@ -8,5 +8,6 @@ sha256sum "scrcpy-server-$VERSION" \
|
||||
"scrcpy-linux-$VERSION.tar.gz" \
|
||||
"scrcpy-win32-$VERSION.zip" \
|
||||
"scrcpy-win64-$VERSION.zip" \
|
||||
"scrcpy-macos-$VERSION.tar.gz" \
|
||||
| tee SHA256SUMS.txt
|
||||
echo "Release checksums generated in $PWD/SHA256SUMS.txt"
|
||||
|
Loading…
x
Reference in New Issue
Block a user