From fb634f50c6011afd055480ec68aacab97b3afce1 Mon Sep 17 00:00:00 2001 From: forge Date: Sun, 10 Nov 2024 17:44:36 +0000 Subject: [PATCH] Add option to fetch webrtc based on signal version --- .forgejo/workflows/generate-webrtc.yml | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/.forgejo/workflows/generate-webrtc.yml b/.forgejo/workflows/generate-webrtc.yml index 9339ce7222ab..8a79fb5ab2d0 100644 --- a/.forgejo/workflows/generate-webrtc.yml +++ b/.forgejo/workflows/generate-webrtc.yml @@ -1,9 +1,13 @@ on: workflow_dispatch: inputs: - ref_name: + signalver: + description: 'signal tag or commit' + required: false + type: string + webrtcver: description: 'webrtc version' - required: true + required: false type: string push: @@ -32,17 +36,28 @@ jobs: git checkout $DEPOT_TOOLS_VER - name: Getting variables run: | - echo $GITHUB_REF_NAME if test $GITHUB_REF_NAME == "ci" ; then - echo ${{ inputs.ref_name }} > webrtcver + _signalver=${{ inputs.signalver }} + _webrtcver=${{ inputs.webrtcver }} else - curl --silent https://raw.githubusercontent.com/signalapp/Signal-Desktop/$GITHUB_REF_NAME/package-lock.json | grep "@signalapp/ringrtc\": \"" | awk '{print $2}' | tr -d ',' | tr -d '"' | head -n 1 > ringrtcver + _signalver=$GITHUB_REF_NAME + fi + if [ -n "$_webrtcver" ]; then + echo "webrtcver set manually with $_webrtcver" + echo $_webrtcver > webrtcver + elif [ -z "$_signalver" ]; then + echo "When Signal commit" is unset, webrtc commit needs be set + return 1 + else + echo "Fetching webrtcver for Signal version $_signalver" + curl --silent https://raw.githubusercontent.com/signalapp/Signal-Desktop/$_signalver/package-lock.json | grep "@signalapp/ringrtc\": \"" | awk '{print $2}' | tr -d ',' | tr -d '"' | head -n 1 > ringrtcver read _ringrtcver < ringrtcver curl --silent https://raw.githubusercontent.com/signalapp/ringrtc/v$_ringrtcver/config/version.properties | awk -F '=' '{if($1 == "webrtc.version"){print $2}}' | head -n 1 > webrtcver fi - name: Fetching webrtc run: | read _webrtcver < webrtcver + echo "Fetching webrtc $_webrtcver" echo "solutions = [{'name': 'src','url': 'https://github.com/signalapp/webrtc.git@$_webrtcver',}]" > .gclient echo "target_cpu = ['x64', 'arm64']" >> .gclient echo "target_cpu_only = True" >> .gclient