-
-
Notifications
You must be signed in to change notification settings - Fork 10.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add GitHub actions for scrcpy server #3721
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
on: | ||
push: | ||
|
||
jobs: | ||
server: | ||
runs-on: ubuntu-latest | ||
container: cimg/android:2022.12.1 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Build | ||
run: | | ||
./gradlew -p server assembleRelease | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: scrcpy | ||
path: ./server/build/outputs/apk/release/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,6 +50,7 @@ echo "Compiling java sources..." | |
cd ../java | ||
javac -bootclasspath "$ANDROID_JAR" -cp "$CLASSES_DIR" -d "$CLASSES_DIR" \ | ||
-source 1.8 -target 1.8 \ | ||
-encoding UTF-8 \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just for my information, was there a problem without it? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
com/genymobile/scrcpy/*.java \ | ||
com/genymobile/scrcpy/wrappers/*.java | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Who created this image? Can we get an image with the necessary to build both the server and the client? (sorry, I'm a newbie in this domain)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These images are generated and maintained by Circle CI, a provider of CI tooling & infrastructure. I had a look at the container images which can be used for building Android apps, and this seemed to be one of the most maintained ones. The source repo is here: https://github.com/CircleCI-Public/cimg-android.
That's a long way to say I think they are fairly trustworthy. I tried to start from ubuntu:jammy and then install ADK from the Ubuntu package repositories, but the ADK that ships with Ubuntu is too old. The other option is to start from a vanilla ubuntu:jammy image (or the vanilla image for your favorite distro) and manually install the ADK. Or not run in a container at all, but directly on the GitHub actions VM, which ship with the ADK as well: https://github.com/actions/runner-images/blob/main/images/linux/Ubuntu2204-Readme.md#android.
In general, I think you're better of using containers because it shields you from any changes on the underlying build machines.
For the app, I would recommend running the build for the app in a separate job in a separate container, as the build dependencies are quite different: the server requires the ADK, the app itself requires headers for libav*, libusb, mingw and a bunch of other dependencies.
I originally had a job which would build the client as well, but then decided against it as I didn't have the time to fully complete that work (done is better than perfect, I guess).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My dev container dockerfile is also based on cimg/android, just only contains the essential components for building Scrcpy: https://github.com/yume-chan/scrcpy-devcontainer/blob/9a7b20391574d25617241d07b75457c9f22dd1a2/.devcontainer/Dockerfile#L30-L51. The origin one needs much more disk space but it should not be an issue on CI.