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
14 changes: 9 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
matrix:
name:
- windows_x86_64
runs-on: windows-latest
runs-on: windows-2022
steps:
- uses: actions/checkout@v4
- name: Disk Cleanup
Expand Down Expand Up @@ -51,7 +51,7 @@ jobs:
fail-fast: false
matrix:
name:
# - macos_arm64
- macos_arm64
- macos_x86_64
# - ios
runs-on: macos-15
Expand All @@ -60,6 +60,10 @@ jobs:
- name: Select Xcode 16.1
run: sudo xcode-select --switch /Applications/Xcode_16.1.app/Contents/Developer
- run: brew install ninja
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- run: pip install setuptools
- run: ./build.${{ matrix.name }}.sh "${{ github.event.inputs.commitHash }}"
- name: Upload Artifact
uses: actions/upload-artifact@v4
Expand All @@ -80,11 +84,11 @@ jobs:
# - ubuntu-18.04_armv8
# - ubuntu-20.04_armv8
# - ubuntu-18.04_x86_64
- ubuntu-20.04_x86_64
# - ubuntu-22.04_x86_64
# - ubuntu-20.04_x86_64
- ubuntu-22.04_x86_64
# - android
# - android_prefixed
runs-on: linux-large
runs-on: linux-large
steps:
- uses: actions/checkout@v4
- name: Disk Cleanup
Expand Down
73 changes: 61 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- windows_x86_64
# - windows_arm64
# - windows_x86
runs-on: windows-latest
runs-on: windows-2022
outputs:
output-artifact-id: ${{ steps.artifact-upload-step.outputs.artifact-id }}
steps:
Expand Down Expand Up @@ -49,7 +49,7 @@ jobs:
uses: actions/upload-artifact@v4
id: artifact-upload-step
with:
name: webrtc.${{ matrix.name }}.tar.bz2
name: webrtc.${{ matrix.name }}
path: build\_package\${{ matrix.name }}\webrtc.tar.bz2
build-macos:
defaults:
Expand All @@ -59,7 +59,7 @@ jobs:
fail-fast: false
matrix:
name:
# - macos_arm64
- macos_arm64
- macos_x86_64
# - ios
runs-on: macos-15
Expand All @@ -70,19 +70,23 @@ jobs:
- name: Select Xcode 16.1
run: sudo xcode-select --switch /Applications/Xcode_16.1.app/Contents/Developer
- run: brew install ninja
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- run: pip install setuptools
- name: Determine Release Tag
env:
RELEASE: ${{ github.ref_name }}
id: release_tag
run: |
echo "tag=${RELEASE%%.*}" >> "$GITHUB_OUTPUT"
echo "3P_WEBRTC_BUILD_RELEASE_VERSION=${RELEASE}" >> "VERSION"
- run: ./build.${{ matrix.name }}.sh "${{ steps.release_tag.outputs.tag }}_release"
- run: ./build.${{ matrix.name }}.sh "${{ steps.release_tag.outputs.tag }}_release"
- name: Upload Artifact
uses: actions/upload-artifact@v4
id: artifact-upload-step
with:
name: webrtc.${{ matrix.name }}.tar.bz2
name: webrtc.${{ matrix.name }}
path: build/_package/${{ matrix.name }}/webrtc.tar.bz2
build-linux:
defaults:
Expand Down Expand Up @@ -128,33 +132,78 @@ jobs:
uses: actions/upload-artifact@v4
id: artifact-upload-step
with:
name: webrtc.${{ matrix.name }}.tar.bz2
name: webrtc.${{ matrix.name }}
path: build/_package/${{ matrix.name }}/webrtc.tar.bz2
package-macos:
needs:
- build-macos
runs-on: macos-15
steps:
- uses: secondlife/action-autobuild@v3
# Checkout first to avoid damaging artifact download below
- name: Checkout
uses: actions/checkout@v4
with:
# Work around the fact that in the context of a pull request github.sha
# references a dynamic merge commit rather than the branch head
# https://frontside.com/blog/2020-05-26-github-actions-pull_request/#how-does-pull_request-affect-actionscheckout
ref: ${{ github.event.pull_request.head.sha || github.sha }}
fetch-depth: 0
submodules: recursive
- name: Download webrtc artifacts
uses: actions/download-artifact@v4
with:
path: _packages
- uses: secondlife/action-autobuild@v5
with:
checkout: false
token: ${{ github.token }}
build-args: ../build-cmd.sh ${{ needs.build-macos.outputs.output-artifact-id }}
package-windows:
needs:
- build-windows
runs-on: windows-latest
- build-windows
runs-on: windows-2022
steps:
- uses: secondlife/action-autobuild@v3
# Checkout first to avoid damaging artifact download below
- name: Checkout
uses: actions/checkout@v4
with:
# Work around the fact that in the context of a pull request github.sha
# references a dynamic merge commit rather than the branch head
# https://frontside.com/blog/2020-05-26-github-actions-pull_request/#how-does-pull_request-affect-actionscheckout
ref: ${{ github.event.pull_request.head.sha || github.sha }}
fetch-depth: 0
submodules: recursive
- name: Download webrtc artifacts
uses: actions/download-artifact@v4
with:
path: _packages
- uses: secondlife/action-autobuild@v5
with:
checkout: false
token: ${{ github.token }}
build-args: ../build-cmd.sh ${{ needs.build-windows.outputs.output-artifact-id }}
package-linux:
needs:
- build-linux
runs-on: ubuntu-latest
runs-on: ubuntu-latest
steps:
- uses: secondlife/action-autobuild@v3
# Checkout first to avoid damaging artifact download below
- name: Checkout
uses: actions/checkout@v4
with:
# Work around the fact that in the context of a pull request github.sha
# references a dynamic merge commit rather than the branch head
# https://frontside.com/blog/2020-05-26-github-actions-pull_request/#how-does-pull_request-affect-actionscheckout
ref: ${{ github.event.pull_request.head.sha || github.sha }}
fetch-depth: 0
submodules: recursive
- name: Download webrtc artifacts
uses: actions/download-artifact@v4
with:
path: _packages
- uses: secondlife/action-autobuild@v5
with:
checkout: false
token: ${{ github.token }}
build-args: ../build-cmd.sh ${{ needs.build-linux.outputs.output-artifact-id }}
release:
Expand Down
89 changes: 49 additions & 40 deletions build-cmd.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

cd "$(dirname "$0")"
artifact_id="$1"
#artifact_id="$1"

# turn on verbose debugging output for logs.
exec 4>&1; export BASH_XTRACEFD=4; set -x
Expand All @@ -17,66 +17,75 @@ set -u
# this command to stop it doing that...
[[ "$OSTYPE" == "cygwin" ]] && set -o igncr

top="$(pwd)"
stage="${top}"/stage

case "$AUTOBUILD_PLATFORM" in
windows64)
windows*)
autobuild="$(cygpath -u "$AUTOBUILD")"
build_type="windows_x86_64"
;;
darwin64)
build_type="macos_x86_64"
darwin*)
autobuild="$AUTOBUILD"
;;
linux*)
build_type="linux_x86_64"
build_type="ubuntu-22.04_x86_64"
autobuild="$AUTOBUILD"
;;
*)
echo "This project is not currently supported for $AUTOBUILD_PLATFORM" 1>&2 ; exit 1

;;
esac

top="$(pwd)"
stage="${top}"/stage

source_environment_tempfile="$stage/source_environment.sh"
"$autobuild" source_environment > "$source_environment_tempfile"
. "$source_environment_tempfile"

pushd "$stage"

# download the artifact
curl -o webrtc.tar.bz2.zip -L -H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
-H "Authorization: Bearer $AUTOBUILD_GITHUB_TOKEN" \
https://api.github.com/repos/secondlife/3p-webrtc-build/actions/artifacts/"$artifact_id"/zip

# delete it so autobuild upload doesn't assume it's a bad autobuild artifact
# TODO: Find a better way to do this that doesn't involve a 3rd party action
#curl -X DELETE -H "Accept: application/vnd.github+json" \
# -H "X-GitHub-Api-Version: 2022-11-28" \
# -H "Authorization: Bearer $AUTOBUILD_GITHUB_TOKEN" \
# https://api.github.com/repos/secondlife/3p-webrtc-build/actions/artifacts/"$artifact_id"

unzip webrtc.tar.bz2.zip
tar xjf webrtc.tar.bz2 --strip-components=1
rm webrtc.tar.bz2.zip
rm webrtc.tar.bz2

# Munge the WebRTC Build package contents into something compatible
# with the layout we use for other autobuild pacakges
mv include webrtc
mkdir include
mv webrtc include
mv lib release
mkdir lib
mv release lib
mkdir LICENSES
mv NOTICE LICENSES/webrtc-license.txt

case "$AUTOBUILD_PLATFORM" in
darwin64)
mv Frameworks/WebRTC.xcframework/macos-x86_64/WebRTC.framework lib/release
darwin*)
mkdir "x86_64"
pushd "x86_64"
tar -xjf "$top"/_packages/webrtc.macos_x86_64/webrtc.tar.bz2 --strip-components=1
popd

mkdir "arm64"
pushd "arm64"
tar -xjf "$top"/_packages/webrtc.macos_arm64/webrtc.tar.bz2 --strip-components=1
popd

# Munge the WebRTC Build package contents into something compatible
# with the layout we use for other autobuild pacakges

# Create universal library
mkdir -p lib/release
lipo -create -output "$stage/lib/release/libwebrtc.a" "$stage/x86_64/lib/libwebrtc.a" "$stage/arm64/lib/libwebrtc.a"

mkdir -p include/webrtc
mv x86_64/include/* include/webrtc

mkdir LICENSES
mv x86_64/NOTICE LICENSES/webrtc-license.txt
;;
*)
tar -xjf "$top"/_packages/webrtc."$build_type"/webrtc.tar.bz2 --strip-components=1

# Munge the WebRTC Build package contents into something compatible
# with the layout we use for other autobuild pacakges
mv include webrtc
mkdir include
mv webrtc include
mv lib release
mkdir lib
mv release lib
mkdir LICENSES
mv NOTICE LICENSES/webrtc-license.txt
;;
*)
echo "This project is not currently supported for $AUTOBUILD_PLATFORM" 1>&2 ; exit 1

;;
esac

Expand Down
Loading
Loading