2020-08-26 08:06:00 -05:00
|
|
|
name: Continuous
|
|
|
|
on:
|
2020-08-27 01:05:11 -05:00
|
|
|
schedule:
|
|
|
|
- cron: "5 */12 * * *"
|
|
|
|
push:
|
2021-09-19 16:01:06 -05:00
|
|
|
branches: [main]
|
2020-08-27 01:05:11 -05:00
|
|
|
pull_request:
|
2021-09-19 16:01:06 -05:00
|
|
|
branches: [main]
|
2020-08-26 08:06:00 -05:00
|
|
|
|
|
|
|
jobs:
|
2020-09-12 08:53:47 -05:00
|
|
|
ubuntu:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
container:
|
2020-09-12 10:05:27 -05:00
|
|
|
image: appimagecrafters/appimage-builder:latest
|
2020-09-12 08:53:47 -05:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Set up User
|
|
|
|
run: |
|
|
|
|
apt update
|
|
|
|
apt install -y sudo
|
|
|
|
echo "github ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
|
|
|
|
useradd -m github
|
|
|
|
usermod -aG sudo github
|
|
|
|
su - github
|
|
|
|
sudo apt -y install git wget curl jq unzip
|
|
|
|
sudo apt -y install build-essential
|
|
|
|
|
|
|
|
|
|
|
|
- name: Clone scrcpy
|
|
|
|
run: |
|
|
|
|
wget https://github.com/ninja-build/ninja/releases/download/v1.10.1/ninja-linux.zip
|
|
|
|
unzip ninja-linux.zip
|
|
|
|
mkdir bin
|
|
|
|
mv ninja bin/.
|
2021-09-19 16:01:06 -05:00
|
|
|
echo "Ninja: $(which ninja)"
|
2020-09-12 08:53:47 -05:00
|
|
|
git clone https://github.com/Genymobile/scrcpy
|
|
|
|
cd scrcpy
|
|
|
|
sudo apt install -y ffmpeg libsdl2-2.0-0 adb
|
|
|
|
# client build dependencies
|
|
|
|
sudo apt install -y gcc git pkg-config ninja-build \
|
|
|
|
libavcodec-dev libavformat-dev libavutil-dev \
|
2021-11-22 06:34:40 -06:00
|
|
|
libsdl2-dev libcroco3 libavdevice-dev libusb-1.0-0-dev
|
2020-09-12 08:53:47 -05:00
|
|
|
sudo apt install -y python3-pip
|
|
|
|
pip3 install meson --user
|
|
|
|
|
|
|
|
- name: Build scrcpy
|
|
|
|
run: |
|
|
|
|
cd scrcpy
|
|
|
|
wget $(curl https://api.github.com/repos/Genymobile/scrcpy/releases/latest | jq -r '.assets[].browser_download_url' | grep server) -O scrcpy_server
|
|
|
|
~/.local/bin/meson x --buildtype release --strip -Db_lto=true \
|
|
|
|
-Dprebuilt_server=./scrcpy_server
|
|
|
|
ninja -Cx
|
|
|
|
sudo ninja -Cx install
|
|
|
|
|
|
|
|
- name: Build AppImage
|
|
|
|
run: |
|
|
|
|
cd scrcpy
|
|
|
|
export APPIMAGE_EXTRACT_AND_RUN=1
|
|
|
|
wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
|
|
|
|
chmod +x linuxdeploy*.AppImage
|
|
|
|
mkdir AppDir
|
|
|
|
export SRC_ROOT=$(realpath ..)
|
|
|
|
export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/pulseaudio/:$LD_LIBRARY_PATH
|
2020-09-14 07:05:29 -05:00
|
|
|
./linuxdeploy*.AppImage -e /usr/local/bin/scrcpy --desktop-file $SRC_ROOT/scrcpy.desktop --icon-file $SRC_ROOT/scrcpy.png --appdir=AppDir --custom-apprun=$SRC_ROOT/AppRun --library=/usr/lib/x86_64-linux-gnu/libsndio.so.6.1 --library=/usr/lib/x86_64-linux-gnu/libicui18n.so.60 --library=/usr/lib/x86_64-linux-gnu/libicudata.so.60 --library=/usr/lib/x86_64-linux-gnu/libnettle.so.6 --library=/usr/lib/x86_64-linux-gnu/libhogweed.so.4 --library=/usr/lib/x86_64-linux-gnu/libicuuc.so.60 --library=/usr/lib/x86_64-linux-gnu/libcroco-0.6.so.3 --library=/usr/lib/x86_64-linux-gnu/libnuma.so.1
|
2020-09-12 08:53:47 -05:00
|
|
|
wget https://dl.google.com/android/repository/platform-tools-latest-linux.zip
|
|
|
|
unzip platform-tools-latest-linux.zip
|
|
|
|
export ADB_DIR=$(realpath platform-tools)
|
|
|
|
export BUILD_DIR=$(realpath x)
|
|
|
|
cp $BUILD_DIR/app/scrcpy AppDir/usr/bin/.
|
|
|
|
cp $ADB_DIR/adb AppDir/usr/bin/.
|
|
|
|
wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage
|
|
|
|
chmod +x appimagetool*.AppImage
|
|
|
|
mkdir -p AppDir/usr/local/share/scrcpy/
|
|
|
|
cp scrcpy_server AppDir/usr/local/share/scrcpy/scrcpy-server
|
|
|
|
./appimagetool*.AppImage AppDir -n -u 'gh-releases-zsync|srevinsaju|scrcpy-appimage|continuous|scrcpy*.AppImage.zsync' scrcpy-$(git describe --tags)-$(uname -m).AppImage
|
|
|
|
mkdir dist
|
|
|
|
mv scrcpy*.AppImage* dist/
|
|
|
|
|
|
|
|
|
2021-09-19 16:08:11 -05:00
|
|
|
- name: Create release and upload artifacts
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
GITHUB_CONTINUOUS_RELEASE_TAG: ${{ matrix.build_type }}
|
|
|
|
CHANGELOG_TYPE: conventional
|
|
|
|
run: |
|
|
|
|
export APPIMAGE_EXTRACT_AND_RUN=1
|
|
|
|
export GITHUB_CONTINUOUS_RELEASE_TAG=continuous
|
|
|
|
export GITHUB_CONTINUOUS_RELEASE_TYPE=prerelease
|
|
|
|
export GITHUB_CONTINUOUS_RELEASE_NAME="Continuous build"
|
|
|
|
wget -q https://github.com/srevinsaju/pyuploadtool/releases/download/continuous/pyuploadtool-x86_64.AppImage && chmod +x pyuploadtool-x86_64.AppImage
|
|
|
|
./pyuploadtool-x86_64.AppImage scrcpy/dist/*.AppImage*
|
2020-09-12 08:53:47 -05:00
|
|
|
|