Skip to content

Commit bc0c2a4

Browse files
Use older actions-autobuild that uses the actions/upload-artiface@3 as v4 is incompatible with actions-autobuild-release (#2)
* Use secondlife/[email protected] for releasing to maintain artifact api @V3 compatibility
1 parent 94c8a12 commit bc0c2a4

File tree

4 files changed

+235
-27
lines changed

4 files changed

+235
-27
lines changed

.github/release.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
changelog:
2+
exclude:
3+
labels:
4+
- ignore-for-release
5+
authors:
6+
- dependabot
7+
categories:
8+
- title: Breaking Changes 🛠
9+
labels:
10+
- semver-major
11+
- breaking-change
12+
- title: New Features 🎉
13+
labels:
14+
- semver-minor
15+
- enhancement
16+
- title: Other Changes
17+
labels:
18+
- '*'

.github/workflows/release.yml

Lines changed: 44 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ jobs:
1616
- windows_x86_64
1717
# - windows_arm64
1818
# - windows_x86
19-
runs-on: windows-2019
19+
runs-on: windows-2022
20+
outputs:
21+
output-artifact-id: ${{ steps.artifact-upload-step.outputs.artifact-id }}
2022
steps:
2123
- uses: actions/checkout@v4
2224
- name: Determine Release Tag
@@ -45,18 +47,10 @@ jobs:
4547
- run: "& .\\build.${{ matrix.name }}.ps1 \"${{ steps.release_tag.outputs.tag }}_release\""
4648
- name: Upload Artifact
4749
uses: actions/upload-artifact@v4
50+
id: artifact-upload-step
4851
with:
4952
name: webrtc.${{ matrix.name }}.tar.bz2
5053
path: build\_package\${{ matrix.name }}\webrtc.tar.bz2
51-
- name: Upload ${{ matrix.name }} Release Asset
52-
uses: actions/[email protected]
53-
env:
54-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55-
with:
56-
upload_url: ${{ github.event.release.upload_url }}
57-
asset_path: build/_package/${{ matrix.name }}/webrtc.tar.bz2
58-
asset_name: webrtc.${{ github.ref_name }}.tar.bz2
59-
asset_content_type: application/bz2
6054
build-macos:
6155
defaults:
6256
run:
@@ -69,6 +63,8 @@ jobs:
6963
- macos_x86_64
7064
# - ios
7165
runs-on: macos-11
66+
outputs:
67+
output-artifact-id: ${{ steps.artifact-upload-step.outputs.artifact-id }}
7268
steps:
7369
- uses: actions/checkout@v4
7470
- name: Select Xcode 13.0
@@ -84,18 +80,10 @@ jobs:
8480
- run: ./build.${{ matrix.name }}.sh "${{ steps.release_tag.outputs.tag }}_release"
8581
- name: Upload Artifact
8682
uses: actions/upload-artifact@v4
83+
id: artifact-upload-step
8784
with:
8885
name: webrtc.${{ matrix.name }}.tar.bz2
8986
path: build/_package/${{ matrix.name }}/webrtc.tar.bz2
90-
- name: Upload ${{ matrix.name }} Release Asset
91-
uses: actions/[email protected]
92-
env:
93-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
94-
with:
95-
upload_url: ${{ github.event.release.upload_url }}
96-
asset_path: build/_package/${{ matrix.name }}/webrtc.tar.bz2
97-
asset_name: webrtc.${{ github.ref_name }}.tar.bz2
98-
asset_content_type: application/bz2
9987
build-linux:
10088
if: false
10189
defaults:
@@ -140,12 +128,41 @@ jobs:
140128
with:
141129
name: webrtc.${{ matrix.name }}.tar.bz2
142130
path: build/_package/${{ matrix.name }}/webrtc.tar.bz2
143-
- name: Upload ${{ matrix.name }} Release Asset
144-
uses: actions/[email protected]
145-
env:
146-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
131+
package-macos:
132+
needs:
133+
- build-macos
134+
strategy:
135+
matrix:
136+
os: [macos-11]
137+
addrsize: ['64']
138+
runs-on: ${{ matrix.os }}
139+
steps:
140+
- uses: secondlife/action-autobuild@3905538e3954f20de482ab980ac982a8a2f01580
147141
with:
148-
upload_url: ${{ github.event.release.upload_url }}
149-
asset_path: build/_package/${{ matrix.name }}/webrtc.tar.bz2
150-
asset_name: webrtc.${{ github.ref_name }}.tar.bz2
151-
asset_content_type: application/bz2
142+
addrsize: ${{ matrix.addrsize }}
143+
token: ${{ github.token }}
144+
build-args: ../build-cmd.sh ${{ needs.build-macos.outputs.output-artifact-id }}
145+
package-windows:
146+
needs:
147+
- build-windows
148+
strategy:
149+
matrix:
150+
os: [windows-2022]
151+
addrsize: ['64']
152+
runs-on: ${{ matrix.os }}
153+
steps:
154+
- uses: secondlife/action-autobuild@3905538e3954f20de482ab980ac982a8a2f01580
155+
with:
156+
addrsize: ${{ matrix.addrsize }}
157+
token: ${{ github.token }}
158+
build-args: ../build-cmd.sh ${{ needs.build-windows.outputs.output-artifact-id }}
159+
release:
160+
needs:
161+
- package-windows
162+
- package-macos
163+
runs-on: [ubuntu-latest]
164+
if: startsWith(github.ref, 'refs/tags/m')
165+
steps:
166+
- uses: secondlife/action-autobuild-release@v3
167+
with:
168+
public: false

autobuild.xml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
<?xml version="1.0" ?>
2+
<llsd>
3+
<map>
4+
<key>package_description</key>
5+
<map>
6+
<key>canonical_repo</key>
7+
<string>https://github.com/secondlife/3p-webrtc-build</string>
8+
<key>copyright</key>
9+
<string>Copyright (c) 2011, The WebRTC project authors. All rights reserved.</string>
10+
<key>license</key>
11+
<string>MIT</string>
12+
<key>license_file</key>
13+
<string>LICENSES/webrtc-license.txt</string>
14+
<key>name</key>
15+
<string>webrtc</string>
16+
<key>platforms</key>
17+
<map>
18+
<key>common</key>
19+
<map>
20+
<key>configurations</key>
21+
<map>
22+
<key>default</key>
23+
<map>
24+
<key>build</key>
25+
<map>
26+
<key>command</key>
27+
<string>bash</string>
28+
</map>
29+
<key>default</key>
30+
<boolean>true</boolean>
31+
<key>name</key>
32+
<string>default</string>
33+
</map>
34+
</map>
35+
<key>name</key>
36+
<string>common</string>
37+
</map>
38+
<key>darwin64</key>
39+
<map>
40+
<key>build_directory</key>
41+
<string>stage</string>
42+
<key>configurations</key>
43+
<map>
44+
<key>default</key>
45+
<map>
46+
<key>default</key>
47+
<boolean>true</boolean>
48+
<key>name</key>
49+
<string>default</string>
50+
</map>
51+
</map>
52+
<key>manifest</key>
53+
<array>
54+
<string>include/*</string>
55+
<string>lib/*</string>
56+
</array>
57+
<key>name</key>
58+
<string>darwin64</string>
59+
</map>
60+
<key>windows64</key>
61+
<map>
62+
<key>build_directory</key>
63+
<string>stage</string>
64+
<key>configurations</key>
65+
<map>
66+
<key>default</key>
67+
<map>
68+
<key>default</key>
69+
<boolean>true</boolean>
70+
<key>name</key>
71+
<string>default</string>
72+
</map>
73+
</map>
74+
<key>manifest</key>
75+
<array>
76+
<string>include/*</string>
77+
<string>lib/*</string>
78+
</array>
79+
<key>name</key>
80+
<string>windows</string>
81+
</map>
82+
</map>
83+
<key>version_file</key>
84+
<string>VERSION.txt</string>
85+
</map>
86+
<key>type</key>
87+
<string>autobuild</string>
88+
<key>version</key>
89+
<string>1.3</string>
90+
</map>
91+
</llsd>

build-cmd.sh

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
#!/usr/bin/env bash
2+
3+
cd "$(dirname "$0")"
4+
artifact_id="$1"
5+
6+
# turn on verbose debugging output for logs.
7+
exec 4>&1; export BASH_XTRACEFD=4; set -x
8+
9+
# make errors fatal
10+
set -e
11+
12+
# bleat on references to undefined shell variables
13+
set -u
14+
15+
# Suddenly, Cygwin inserts extra CRLFs in places such
16+
# as the code that extracts version numbers so we need
17+
# this command to stop it doing that...
18+
[[ "$OSTYPE" == "cygwin" ]] && set -o igncr
19+
20+
top="$(pwd)"
21+
stage="${top}"/stage
22+
23+
case "$AUTOBUILD_PLATFORM" in
24+
windows64)
25+
autobuild="$(cygpath -u "$AUTOBUILD")"
26+
build_type="windows_x86_64"
27+
;;
28+
darwin64)
29+
autobuild="$AUTOBUILD"
30+
build_type="macos_x86_64"
31+
;;
32+
*)
33+
echo "This project is not currently supported for $AUTOBUILD_PLATFORM" 1>&2 ; exit 1
34+
35+
;;
36+
esac
37+
38+
source_environment_tempfile="$stage/source_environment.sh"
39+
"$autobuild" source_environment > "$source_environment_tempfile"
40+
. "$source_environment_tempfile"
41+
42+
pushd "$stage"
43+
44+
# download the artifact
45+
curl -o webrtc.tar.bz2.zip -L -H "Accept: application/vnd.github+json" \
46+
-H "X-GitHub-Api-Version: 2022-11-28" \
47+
-H "Authorization: Bearer $AUTOBUILD_GITHUB_TOKEN" \
48+
https://api.github.com/repos/secondlife/3p-webrtc-build/actions/artifacts/"$artifact_id"/zip
49+
50+
# delete it so autobuild upload doesn't assume it's a bad autobuild artifact
51+
# TODO: Find a better way to do this that doesn't involve a 3rd party action
52+
#curl -X DELETE -H "Accept: application/vnd.github+json" \
53+
# -H "X-GitHub-Api-Version: 2022-11-28" \
54+
# -H "Authorization: Bearer $AUTOBUILD_GITHUB_TOKEN" \
55+
# https://api.github.com/repos/secondlife/3p-webrtc-build/actions/artifacts/"$artifact_id"
56+
57+
unzip webrtc.tar.bz2.zip
58+
tar xjf webrtc.tar.bz2 --strip-components=1
59+
rm webrtc.tar.bz2.zip
60+
rm webrtc.tar.bz2
61+
62+
# Munge the WebRTC Build package contents into something compatible
63+
# with the layout we use for other autobuild pacakges
64+
mv include webrtc
65+
mkdir include
66+
mv webrtc include
67+
mv lib release
68+
mkdir lib
69+
mv release lib
70+
mkdir LICENSES
71+
mv NOTICE LICENSES/webrtc-license.txt
72+
73+
case "$AUTOBUILD_PLATFORM" in
74+
darwin64)
75+
mv Frameworks/WebRTC.xcframework/macos-x86_64/WebRTC.framework lib/release
76+
;;
77+
esac
78+
79+
build=${AUTOBUILD_BUILD_ID:=0}
80+
echo "${GITHUB_REF:10}.${build}" > "VERSION.txt"
81+
popd
82+

0 commit comments

Comments
 (0)