signal-desktop/.forgejo/workflows/generate-webrtc.yml

89 lines
5.2 KiB
YAML
Raw Normal View History

2024-09-10 00:32:06 +00:00
on:
workflow_dispatch:
inputs:
ref_name:
description: 'webrtc version'
required: true
type: string
2024-09-10 00:34:31 +00:00
push:
tags:
2024-09-12 13:25:58 +00:00
- 'v7.2*'
2024-09-12 13:24:14 +00:00
tags-ignore:
- '*-beta*'
2024-09-10 00:34:31 +00:00
2024-09-10 00:32:06 +00:00
jobs:
build-tarball:
name: Build tarball
runs-on: x86_64
container:
image: alpine:3.19
env:
VPYTHON_BYPASS: manually managed python not supported by chrome operations
ZSTD_LIMIT: 0
DEPOT_TOOLS_VER: ae3745656b1111c995e41ec70eaa4397eaea7951
steps:
- name: Environment setup
run: apk add nodejs git zstd tar sed bash py3-httplib2 wget curl
- name: Getting depot_tools
run: |
git clone --depth 1 https://chromium.googlesource.com/chromium/tools/depot_tools.git ./
git fetch --depth 1 origin $DEPOT_TOOLS_VER
git checkout $DEPOT_TOOLS_VER
2024-09-10 00:42:56 +00:00
- name: Getting variables
2024-09-10 00:32:06 +00:00
run: |
if test $GITHUB_REF_NAME == "ci" ; then
CI_REF_NAME=${{ inputs.ref_name }}
else
CI_REF_NAME=$GITHUB_REF_NAME
fi
2024-09-12 16:26:49 +00:00
echo $CI_REF_NAME > ci_ref_name
curl --silent https://raw.githubusercontent.com/signalapp/Signal-Desktop/$CI_REF_NAME/package-lock.json | grep "@signalapp/ringrtc\": \"" | awk '{print $2}' | tr -d ',' | tr -d '"' | head -n 1 > ringrtcver
curl --silent https://raw.githubusercontent.com/signalapp/Signal-Desktop/$CI_REF_NAME/package-lock.json | grep "@signalapp/libsignal-client\": \"" | awk '{print $2}' | tr -d ',' | tr -d '"' | head -n 1 > libsignalver
curl --silent https://raw.githubusercontent.com/signalapp/Signal-Desktop/$CI_REF_NAME/package-lock.json | grep "@signalapp/better-sqlite3\": \"" | awk '{print $2}' | tr -d ',' | tr -d '"' | head -n 1 > bsqlitever
read _bsqlitever < bsqlitever
2024-09-12 15:52:28 +00:00
curl --silent https://raw.githubusercontent.com/signalapp/better-sqlite3/v$_bsqlitever/deps/download.js | grep "const TOKENIZER_VERSION" | awk '{print $4}' | tr -d "'" | tr -d ';' | head -n 1 > stokenizerver
2024-09-10 00:42:56 +00:00
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
read _libsignalver < libsignalver
read _webrtcver < webrtcver
read _stokenizerver < stokenizerver
echo "_libsignalver=$_libsignalver" > dependencies.conf
echo "_ringrtcver=$_ringrtcver" >> dependencies.conf
echo "_webrtcver=$_webrtcver" >> dependencies.conf
echo "_stokenizerver=$_stokenzerver" >> dependencies.conf
2024-09-10 00:42:56 +00:00
- name: Fetching webrtc
run: |
read _webrtcver < webrtcver
2024-09-10 00:32:06 +00:00
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
./gclient sync --no-history --nohooks
- name: Preparing source
run: |
2024-09-10 00:42:56 +00:00
read _webrtcver < webrtcver
2024-09-10 00:32:06 +00:00
python3 'src/build/landmines.py' --landmine-scripts 'src/tools_webrtc/get_landmines.py' --src-dir 'src'
python3 'src/build/util/lastchange.py' -o 'src/build/util/LASTCHANGE'
scanelf -RA -F "%F" src > elf.list
while read file; do rm -f "$file"; done < elf.list
mv src webrtc-$_webrtcver
- name: Packaging source
run: |
2024-09-10 00:42:56 +00:00
read _webrtcver < webrtcver
2024-09-10 00:32:06 +00:00
tar -cf webrtc-$_webrtcver.tar --exclude="ChangeLog*" --exclude="testdata/" --exclude="test_data/" --exclude="android_rust_toolchain/toolchain/" --exclude="base/" --exclude-backups --exclude-caches-all --exclude-vcs webrtc-$_webrtcver
zstd --auto-threads=logical --ultra --long -22 -T"$ZSTD_LIMIT" -vv webrtc-$_webrtcver.tar -o webrtc-$_webrtcver.tar.zst
- name: Computing checksums
run: |
2024-09-10 00:42:56 +00:00
read _webrtcver < webrtcver
2024-09-10 00:32:06 +00:00
sha512sum webrtc-$_webrtcver.tar.zst > webrtc-$_webrtcver.tar.zst.sha512sum
sha256sum webrtc-$_webrtcver.tar.zst > webrtc-$_webrtcver.tar.zst.sha256sum
- name: Package deployment
run: |
2024-09-10 00:42:56 +00:00
read _webrtcver < webrtcver
2024-09-12 16:26:49 +00:00
read CI_REF_NAME < ci_ref_name
echo "Sending to ${{ github.server_url }}/api/packages/mirrors/generic/signal-desktop/$CI_REF_NAME/webrtc-$_webrtcver.tar.zst"
curl --user ${{ vars.CODE_FORGEJO_USER }}:${{ secrets.CODE_FORGEJO_TOKEN }} --upload-file webrtc-*.tar.zst ${{ github.server_url }}/api/packages/mirrors/generic/signal-desktop/$CI_REF_NAME/webrtc-$_webrtcver.tar.zst
curl --user ${{ vars.CODE_FORGEJO_USER }}:${{ secrets.CODE_FORGEJO_TOKEN }} --upload-file webrtc-*.tar.zst.sha512sum ${{ github.server_url }}/api/packages/mirrors/generic/signal-desktop/$CI_REF_NAME/webrtc-$_webrtcver.tar.zst.sha512sum
curl --user ${{ vars.CODE_FORGEJO_USER }}:${{ secrets.CODE_FORGEJO_TOKEN }} --upload-file webrtc-*.tar.zst.sha256sum ${{ github.server_url }}/api/packages/mirrors/generic/signal-desktop/$CI_REF_NAME/webrtc-$_webrtcver.tar.zst.sha256sum
curl --user ${{ vars.CODE_FORGEJO_USER }}:${{ secrets.CODE_FORGEJO_TOKEN }} --upload-file dependencies.conf ${{ github.server_url }}/api/packages/mirrors/generic/signal-desktop/$CI_REF_NAME/dependencies.conf