Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 88 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -172,34 +172,71 @@ jobs:
name: build-win32-intermediate
path: release/work/build-win32/dist-tar/

build-win64:
runs-on: ubuntu-latest
build-windows:
strategy:
fail-fast: false
matrix:
include:
- arch: '64'
target: win64
runs-on: ubuntu-latest
shell: bash
- arch: arm64
target: winarm64
runs-on: windows-11-arm
shell: 'msys2 {0}'
runs-on: ${{ matrix.runs-on }}
defaults:
run:
shell: ${{ matrix.shell }}
steps:
- name: Checkout code
uses: actions/checkout@v6

- name: Install dependencies
- name: Install dependencies (Linux cross-build)
if: matrix.target == 'win64'
run: |
sudo apt update
sudo apt install -y meson ninja-build nasm \
mingw-w64 mingw-w64-tools libz-mingw-w64-dev

- name: Setup MSYS2 (native Windows ARM64 build)
if: matrix.target == 'winarm64'
uses: msys2/setup-msys2@v2
with:
msystem: CLANGARM64
update: true
install: >-
base-devel
unzip
wget
autoconf
automake
libtool
make
mingw-w64-clang-aarch64-toolchain
mingw-w64-clang-aarch64-meson
mingw-w64-clang-aarch64-ninja
mingw-w64-clang-aarch64-cmake
mingw-w64-clang-aarch64-pkgconf
mingw-w64-clang-aarch64-zlib

- name: Build
run: release/build_windows.sh 64
run: release/build_windows.sh ${{ matrix.arch }}

# upload-artifact does not preserve permissions
- name: Tar
run: |
cd release/work/build-win64
cd release/work/build-${{ matrix.target }}
mkdir dist-tar
cd dist-tar
tar -C .. -cvf dist.tar.gz dist/

- name: Upload artifact
uses: actions/upload-artifact@v7
with:
name: build-win64-intermediate
path: release/work/build-win64/dist-tar/
name: build-${{ matrix.target }}-intermediate
path: release/work/build-${{ matrix.target }}/dist-tar/

build-macos-aarch64:
runs-on: macos-latest
Expand Down Expand Up @@ -362,7 +399,7 @@ jobs:
package-win64:
needs:
- build-scrcpy-server
- build-win64
- build-windows
runs-on: ubuntu-latest
steps:
- name: Checkout code
Expand Down Expand Up @@ -395,6 +432,42 @@ jobs:
name: release-win64
path: release/output

package-winarm64:
needs:
- build-scrcpy-server
- build-windows
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6

- name: Download scrcpy-server
uses: actions/download-artifact@v8
with:
name: scrcpy-server
path: release/work/build-server/server/

- name: Download build-winarm64
uses: actions/download-artifact@v8
with:
name: build-winarm64-intermediate
path: release/work/build-winarm64/dist-tar/

# upload-artifact does not preserve permissions
- name: Detar
run: |
cd release/work/build-winarm64
tar xf dist-tar/dist.tar.gz

- name: Package
run: release/package_client.sh winarm64 zip

- name: Upload release
uses: actions/upload-artifact@v7
with:
name: release-winarm64
path: release/output

package-macos-aarch64:
needs:
- build-scrcpy-server
Expand Down Expand Up @@ -473,6 +546,7 @@ jobs:
- package-linux-x86_64
- package-win32
- package-win64
- package-winarm64
- package-macos-aarch64
- package-macos-x86_64
runs-on: ubuntu-latest
Expand Down Expand Up @@ -504,6 +578,12 @@ jobs:
name: release-win64
path: release/output/

- name: Download release-winarm64
uses: actions/download-artifact@v8
with:
name: release-winarm64
path: release/output/

- name: Download release-macos-aarch64
uses: actions/download-artifact@v8
with:
Expand Down
8 changes: 8 additions & 0 deletions app/deps/ffmpeg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,14 @@ else
echo "Unsupported host: $HOST" >&2
exit 1
esac
elif [[ "$HOST" == winarm64 ]]
then
# Native Windows ARM64 build (MSYS2 CLANGARM64 provides clang, not gcc)
conf+=(
--target-os=mingw32
--arch=aarch64
--cc=clang
)
fi

"$SOURCES_DIR/$PROJECT_DIR"/configure "${conf[@]}"
Expand Down
53 changes: 38 additions & 15 deletions release/build_windows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,18 @@ set -ex
case "$1" in
32)
WINXX=win32
BUILD_TYPE=cross
;;
64)
WINXX=win64
BUILD_TYPE=cross
;;
arm64)
WINXX=winarm64
BUILD_TYPE=native
;;
*)
echo "ERROR: $0 must be called with one argument: 32 or 64" >&2
echo "ERROR: $0 must be called with one argument: 32, 64 or arm64" >&2
exit 1
;;
esac
Expand All @@ -20,29 +26,46 @@ cd .. # root project dir

WINXX_BUILD_DIR="$WORK_DIR/build-$WINXX"

# Prefer Ninja for CMake-based deps on MSYS2 (avoids "MSYS Makefiles" quirks).
# MSYS2 CLANGARM64 provides clang, not gcc — make autotools/cmake/configure
# pick it up by default.
if [[ "$BUILD_TYPE" == native ]]
then
export CMAKE_GENERATOR=Ninja
export CC=clang
export CXX=clang++
fi

app/deps/adb_windows.sh
app/deps/sdl.sh $WINXX cross shared
app/deps/dav1d.sh $WINXX cross shared
app/deps/ffmpeg.sh $WINXX cross shared
app/deps/libusb.sh $WINXX cross shared
app/deps/sdl.sh $WINXX $BUILD_TYPE shared
app/deps/dav1d.sh $WINXX $BUILD_TYPE shared
app/deps/ffmpeg.sh $WINXX $BUILD_TYPE shared
app/deps/libusb.sh $WINXX $BUILD_TYPE shared

DEPS_INSTALL_DIR="$PWD/app/deps/work/install/$WINXX-cross-shared"
DEPS_INSTALL_DIR="$PWD/app/deps/work/install/$WINXX-$BUILD_TYPE-shared"
ADB_INSTALL_DIR="$PWD/app/deps/work/install/adb-windows"

# Never fall back to system libs
unset PKG_CONFIG_PATH
export PKG_CONFIG_LIBDIR="$DEPS_INSTALL_DIR/lib/pkgconfig"

rm -rf "$WINXX_BUILD_DIR"
meson setup "$WINXX_BUILD_DIR" \
-Dc_args="-I$DEPS_INSTALL_DIR/include" \
-Dc_link_args="-L$DEPS_INSTALL_DIR/lib" \
--cross-file=cross_$WINXX.txt \
--buildtype=release \
--strip \
-Db_lto=true \
-Dcompile_server=false \
meson_args=(
-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
)

if [[ "$BUILD_TYPE" == cross ]]
then
meson_args+=(--cross-file=cross_$WINXX.txt)
fi

rm -rf "$WINXX_BUILD_DIR"
meson setup "$WINXX_BUILD_DIR" "${meson_args[@]}"
ninja -C "$WINXX_BUILD_DIR"

# Group intermediate outputs into a 'dist' directory
Expand Down
1 change: 1 addition & 0 deletions release/generate_checksums.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ sha256sum "scrcpy-server-$VERSION" \
"scrcpy-linux-x86_64-$VERSION.tar.gz" \
"scrcpy-win32-$VERSION.zip" \
"scrcpy-win64-$VERSION.zip" \
"scrcpy-winarm64-$VERSION.zip" \
"scrcpy-macos-aarch64-$VERSION.tar.gz" \
"scrcpy-macos-x86_64-$VERSION.tar.gz" \
| tee SHA256SUMS.txt
Expand Down