Skip to content

Commit

Permalink
Specify architecture for Linux and macOS releases
Browse files Browse the repository at this point in the history
PR #5526 <#5526>

Co-authored-by: Genxster1998 <[email protected]>
  • Loading branch information
rom1v and Genxster1998 committed Nov 28, 2024
1 parent acddd81 commit 618a978
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 38 deletions.
64 changes: 32 additions & 32 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ jobs:
- name: Test
run: release/test_client.sh

build-linux:
build-linux-x86_64:
runs-on: ubuntu-latest
steps:
- name: Checkout code
Expand All @@ -96,21 +96,21 @@ jobs:
libv4l-dev
- name: Build
run: release/build_linux.sh
run: release/build_linux.sh x86_64

# upload-artifact does not preserve permissions
- name: Tar
run: |
cd release/work/build-linux
cd release/work/build-linux-x86_64
mkdir dist-tar
cd dist-tar
tar -C .. -cvf dist.tar.gz dist/
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: build-linux-intermediate
path: release/work/build-linux/dist-tar/
name: build-linux-x86_64-intermediate
path: release/work/build-linux-x86_64/dist-tar/

build-win32:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -178,7 +178,7 @@ jobs:
name: build-win64-intermediate
path: release/work/build-win64/dist-tar/

build-macos:
build-macos-aarch64:
runs-on: macos-latest
steps:
- name: Checkout code
Expand All @@ -190,26 +190,26 @@ jobs:
libtool
- name: Build
run: release/build_macos.sh
run: release/build_macos.sh aarch64

# upload-artifact does not preserve permissions
- name: Tar
run: |
cd release/work/build-macos
cd release/work/build-macos-aarch64
mkdir dist-tar
cd dist-tar
tar -C .. -cvf dist.tar.gz dist/
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: build-macos-intermediate
path: release/work/build-macos/dist-tar/
name: build-macos-aarch64-intermediate
path: release/work/build-macos-aarch64/dist-tar/

package-linux:
package-linux-x86_64:
needs:
- build-scrcpy-server
- build-linux
- build-linux-x86_64
runs-on: ubuntu-latest
steps:
- name: Checkout code
Expand All @@ -221,25 +221,25 @@ jobs:
name: scrcpy-server
path: release/work/build-server/server/

- name: Download build-linux
- name: Download build-linux-x86_64
uses: actions/download-artifact@v4
with:
name: build-linux-intermediate
path: release/work/build-linux/dist-tar/
name: build-linux-x86_64-intermediate
path: release/work/build-linux-x86_64/dist-tar/

# upload-artifact does not preserve permissions
- name: Detar
run: |
cd release/work/build-linux
cd release/work/build-linux-x86_64
tar xf dist-tar/dist.tar.gz
- name: Package
run: release/package_client.sh linux tar.gz
run: release/package_client.sh linux-x86_64 tar.gz

- name: Upload release
uses: actions/upload-artifact@v4
with:
name: release-linux
name: release-linux-x86_64
path: release/output/

package-win32:
Expand Down Expand Up @@ -314,10 +314,10 @@ jobs:
name: release-win64
path: release/output

package-macos:
package-macos-aarch64:
needs:
- build-scrcpy-server
- build-macos
- build-macos-aarch64
runs-on: ubuntu-latest
steps:
- name: Checkout code
Expand All @@ -329,34 +329,34 @@ jobs:
name: scrcpy-server
path: release/work/build-server/server/

- name: Download build-macos
- name: Download build-macos-aarch64
uses: actions/download-artifact@v4
with:
name: build-macos-intermediate
path: release/work/build-macos/dist-tar/
name: build-macos-aarch64-intermediate
path: release/work/build-macos-aarch64/dist-tar/

# upload-artifact does not preserve permissions
- name: Detar
run: |
cd release/work/build-macos
cd release/work/build-macos-aarch64
tar xf dist-tar/dist.tar.gz
- name: Package
run: release/package_client.sh macos tar.gz
run: release/package_client.sh macos-aarch64 tar.gz

- name: Upload release
uses: actions/upload-artifact@v4
with:
name: release-macos
name: release-macos-aarch64
path: release/output/

release:
needs:
- build-scrcpy-server
- package-linux
- package-linux-x86_64
- package-win32
- package-win64
- package-macos
- package-macos-aarch64
runs-on: ubuntu-latest
steps:
- name: Checkout code
Expand All @@ -368,10 +368,10 @@ jobs:
name: scrcpy-server
path: release/work/build-server/server/

- name: Download release-linux
- name: Download release-linux-x86_64
uses: actions/download-artifact@v4
with:
name: release-linux
name: release-linux-x86_64
path: release/output/

- name: Download release-win32
Expand All @@ -386,10 +386,10 @@ jobs:
name: release-win64
path: release/output/

- name: Download release-macos
- name: Download release-macos-aarch64
uses: actions/download-artifact@v4
with:
name: release-macos
name: release-macos-aarch64
path: release/output/

- name: Package server
Expand Down
9 changes: 8 additions & 1 deletion release/build_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@ cd "$(dirname ${BASH_SOURCE[0]})"
. build_common
cd .. # root project dir

LINUX_BUILD_DIR="$WORK_DIR/build-linux"
if [[ $# != 1 ]]
then
echo "Syntax: $0 <arch>" >&2
exit 1
fi

ARCH="$1"
LINUX_BUILD_DIR="$WORK_DIR/build-linux-$ARCH"

app/deps/adb_linux.sh
app/deps/sdl.sh linux native static
Expand Down
9 changes: 8 additions & 1 deletion release/build_macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@ cd "$(dirname ${BASH_SOURCE[0]})"
. build_common
cd .. # root project dir

MACOS_BUILD_DIR="$WORK_DIR/build-macos"
if [[ $# != 1 ]]
then
echo "Syntax: $0 <arch>" >&2
exit 1
fi

ARCH="$1"
MACOS_BUILD_DIR="$WORK_DIR/build-macos-$ARCH"

app/deps/adb_macos.sh
app/deps/sdl.sh macos native static
Expand Down
4 changes: 2 additions & 2 deletions release/generate_checksums.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ cd "$(dirname ${BASH_SOURCE[0]})"

cd "$OUTPUT_DIR"
sha256sum "scrcpy-server-$VERSION" \
"scrcpy-linux-$VERSION.tar.gz" \
"scrcpy-linux-x86_64-$VERSION.tar.gz" \
"scrcpy-win32-$VERSION.zip" \
"scrcpy-win64-$VERSION.zip" \
"scrcpy-macos-$VERSION.tar.gz" \
"scrcpy-macos-aarch64-$VERSION.tar.gz" \
| tee SHA256SUMS.txt
echo "Release checksums generated in $PWD/SHA256SUMS.txt"
4 changes: 2 additions & 2 deletions release/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ rm -rf output
./build_server.sh
./build_windows.sh 32
./build_windows.sh 64
./build_linux.sh
./build_linux.sh x86_64

./package_server.sh
./package_client.sh win32 zip
./package_client.sh win64 zip
./package_client.sh linux tar.gz
./package_client.sh linux-x86_64 tar.gz

./generate_checksums.sh

Expand Down

0 comments on commit 618a978

Please sign in to comment.