forked from signalapp/ringrtc
-
Notifications
You must be signed in to change notification settings - Fork 1
64 lines (53 loc) · 1.64 KB
/
sync.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: Sync Upstream
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
permissions:
contents: read
jobs:
sync_ringrtc:
name: Sync RingRTC
if: "github.repository_owner == 'mollyim'"
runs-on: ubuntu-latest
outputs:
webrtc-version: ${{ steps.set.outputs.webrtc-version }}
steps:
- uses: actions/checkout@v4
with:
ref: upstream
fetch-depth: 0
token: ${{ secrets.PUBLISH_PAT }}
- name: Fetch and merge upstream changes
run: |
git remote add upstream https://github.com/signalapp/ringrtc.git
git fetch upstream
git merge --ff-only upstream/main
- name: Push changes to origin
run: |
git push origin upstream
git tag | grep -xP 'v\d+(?:\.\d+){2,3}' | xargs -r git push origin
- name: Output WebRTC version
id: set
run: |
ver=$(grep '^webrtc.version=' config/version.properties | cut -d'=' -f2)
echo "webrtc-version=$ver" >> $GITHUB_OUTPUT
update_webrtc_tag:
name: Update WebRTC Version
runs-on: ubuntu-latest
needs: sync_ringrtc
steps:
- name: Checkout WebRTC
uses: actions/checkout@v4
with:
repository: mollyim/webrtc
token: ${{ secrets.PUBLISH_PAT }}
- name: Fetch upstream tags
run: |
git remote add upstream https://github.com/signalapp/webrtc.git
git fetch --tags upstream
- name: Push RingRTC version tag to origin
run: |
git push origin "$WEBRTC_VERSION"
env:
WEBRTC_VERSION: ${{ needs.sync_ringrtc.outputs.webrtc-version }}