Seperate webrtc and dependencies conf

This commit is contained in:
Antoine Martin 2024-09-12 20:45:56 -04:00
parent caafa9e95b
commit 57c2af5828
Signed by: forge
GPG key ID: D62A472A4AA7D541
2 changed files with 45 additions and 18 deletions

View file

@ -0,0 +1,41 @@
on:
workflow_dispatch:
inputs:
ref_name:
description: 'webrtc version'
required: true
type: string
push:
tags:
- 'v7*'
jobs:
build-tarball:
name: Build tarball
runs-on: x86_64
container:
image: alpine:3.19
steps:
- name: Environment setup
run: apk add nodejs git zstd tar sed bash py3-httplib2 wget curl
- name: Getting variables
run: |
if test $GITHUB_REF_NAME == "ci" ; then
CI_REF_NAME=${{ inputs.ref_name }}
else
CI_REF_NAME=$GITHUB_REF_NAME
fi
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
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
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
- name: Package deployment
run: |
read CI_REF_NAME < ci_ref_name
echo "Sending to ${{ github.server_url }}/api/packages/mirrors/generic/signal-desktop/$CI_REF_NAME/dependencies.conf"
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

View file

@ -37,21 +37,9 @@ jobs:
else
CI_REF_NAME=$GITHUB_REF_NAME
fi
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
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
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=$_stokenizerver" >> dependencies.conf
- name: Fetching webrtc
run: |
read _webrtcver < webrtcver
@ -80,9 +68,7 @@ jobs:
- name: Package deployment
run: |
read _webrtcver < webrtcver
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
echo "Sending to ${{ github.server_url }}/api/packages/mirrors/generic/webrtc/$_webrtcver/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/webrtc/$_webrtcver/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/webrtc/$_webrtcver/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/webrtc/$_webrtcver/webrtc-$_webrtcver.tar.zst.sha256sum