-
Notifications
You must be signed in to change notification settings - Fork 43
87 lines (80 loc) · 2.96 KB
/
Copy pathfetch-webrtc-artifacts.yml
File metadata and controls
87 lines (80 loc) · 2.96 KB
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# Fetches webrtc.android*.tar.gz artifacts from a workflow run in webrtc-sdk/webrtc-build.
# Required: secret WEBRTC_ARTIFACT_FETCH_TOKEN (PAT with repo + actions:read on the source repo).
# Run ID: from the Actions run URL in webrtc-build, e.g. .../actions/runs/123456789
name: Fetch WebRTC artifacts and create release
on:
workflow_dispatch:
inputs:
run_id:
description: 'Workflow run ID from webrtc-sdk/webrtc-build (from the Actions run URL)'
required: true
type: string
repo:
description: 'Source repo (owner/repo) that produced the artifacts'
required: false
default: 'webrtc-sdk/webrtc-build'
type: string
release_tag:
description: 'Tag name for the draft release (e.g. v1.0.0 or webrtc-12345)'
required: true
type: string
jobs:
fetch-artifacts:
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
fail-fast: false
matrix:
include:
- artifact_name: webrtc.android.tar.gz
output_name: libwebrtc.aar
path_suffix: webrtc-android
- artifact_name: webrtc.android_prefixed.tar.gz
output_name: libwebrtc_prefixed.aar
path_suffix: webrtc-android-prefixed
- artifact_name: webrtc.android_prefixed_stripped.tar.gz
output_name: libwebrtc_prefixed_stripped.aar
path_suffix: webrtc-android-prefixed-stripped
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download artifact
uses: dawidd6/action-download-artifact@v16
with:
run_id: ${{ inputs.run_id }}
repo: ${{ inputs.repo }}
name: ${{ matrix.artifact_name }}
path: ./artifacts/${{ matrix.path_suffix }}
github_token: ${{ secrets.WEBRTC_ARTIFACT_FETCH_TOKEN }}
- name: Untar and extract libwebrtc.aar
run: |
mkdir -p ./aar-output
TAR=$(find ./artifacts/${{ matrix.path_suffix }} -name '${{ matrix.artifact_name }}' -type f | head -1)
tar -xzf "$TAR" -C ./artifacts/${{ matrix.path_suffix }}
cp "$(find ./artifacts/${{ matrix.path_suffix }} -name 'libwebrtc.aar' -type f | head -1)" ./aar-output/${{ matrix.output_name }}
- name: Upload AAR
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.output_name }}
path: ./aar-output/${{ matrix.output_name }}
release:
runs-on: ubuntu-latest
permissions:
contents: write
needs: fetch-artifacts
steps:
- name: Download all AARs
uses: actions/download-artifact@v4
with:
path: ./aar-output
merge-multiple: true
- name: Create draft release and upload AARs
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.event.inputs.release_tag }}
draft: true
files: |
aar-output/*.aar
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}