Skip to content

Commit c776f66

Browse files
authored
stop building linux/macos shared libraries during release (#574)
1 parent f3c4e9d commit c776f66

File tree

4 files changed

+43
-180
lines changed

4 files changed

+43
-180
lines changed

.github/workflows/release_gh.yaml

Lines changed: 0 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -86,66 +86,6 @@ jobs:
8686
with:
8787
name: Capture.android.zip
8888
path: ./dist/Capture.android.zip
89-
# Builds libcapture.so targeting Linux, to support instant-android using the .aar on Linux CI machines.
90-
build-android-linux-so:
91-
name: Linux x86_64 libcapture.so
92-
# Running on ubuntu-latest builds againt a glibc that is more modern than what
93-
# instant-android uses in CI, causing a load error. Use 20.04 to link against a compatible
94-
# glibc.
95-
runs-on: ubuntu-latest
96-
needs: ["verify-version"]
97-
steps:
98-
- uses: actions/checkout@v4
99-
with:
100-
ref: ${{ inputs.sha }}
101-
- name: Install Clang
102-
run: sudo apt-get install -y clang
103-
104-
- name: build
105-
run: ./ci/create_linux_java_so.sh
106-
- uses: actions/upload-artifact@v4
107-
with:
108-
name: libcapture.so
109-
path: ./bazel-bin/platform/jvm/libcapture.so
110-
# Builds libcapture.dylib targeting macos arm64, to support instant-android using the .aar on arm64 Macs.
111-
build-android-macos-arm64:
112-
name: arm64 libcapture.dylib
113-
runs-on: macos-15
114-
needs: ["verify-version"]
115-
steps:
116-
- uses: actions/checkout@v4
117-
with:
118-
ref: ${{ inputs.sha }}
119-
- name: 'Update the content of platform/shared/.sdk_version'
120-
run: echo "${{ inputs.version }}" > platform/shared/.sdk_version
121-
- name: 'Install dependencies'
122-
run: ./ci/mac_ci_setup.sh
123-
- name: build
124-
run: ./bazelw build --announce_rc --config=ci --config=release-common --cpu=darwin_arm64 --platforms @build_bazel_apple_support//platforms:macos_arm64 //platform/jvm:capture && cp bazel-bin/platform/jvm/libcapture.dylib libcapture.dylib.arm64
125-
- uses: actions/upload-artifact@v4
126-
with:
127-
name: libcapture.dylib.arm64
128-
path: libcapture.dylib.arm64
129-
# Builds libcapture.dylib targeting macos x86_64, to support instant-android using the .aar on arm64 Macs.
130-
build-android-macos-x86_64:
131-
name: x86_64 libcapture.dylib
132-
runs-on: macos-15
133-
needs: ["verify-version"]
134-
steps:
135-
# Checkout repo to Github Actions runner
136-
- uses: actions/checkout@v4
137-
with:
138-
ref: ${{ inputs.sha }}
139-
- name: 'Update the content of platform/shared/.sdk_version'
140-
run: echo "${{ inputs.version }}" > platform/shared/.sdk_version
141-
- name: 'Install dependencies'
142-
run: ./ci/mac_ci_setup.sh
143-
- name: build
144-
run: ./bazelw build --announce_rc --config=ci --config=release-common --cpu=darwin_x86_64 //platform/jvm:capture && cp bazel-bin/platform/jvm/libcapture.dylib libcapture.dylib.x86_64
145-
- uses: actions/upload-artifact@v4
146-
with:
147-
name: libcapture.dylib.x86_64
148-
path: libcapture.dylib.x86_64
14989
build-android-example-apps:
15090
needs: ["verify-version"]
15191
permissions:
@@ -172,9 +112,6 @@ jobs:
172112
"ios-release-build",
173113
"build-ios-example-apps",
174114
"android-release-build",
175-
"build-android-linux-so",
176-
"build-android-macos-x86_64",
177-
"build-android-macos-arm64",
178115
"build-android-example-apps",
179116
"build-android-integrations",
180117
]
@@ -187,18 +124,6 @@ jobs:
187124
uses: actions/download-artifact@v4
188125
with:
189126
name: Capture.android.zip
190-
- name: Download Android Capture .so
191-
uses: actions/download-artifact@v4
192-
with:
193-
name: libcapture.so
194-
- name: Download Android Capture .dylib.arm64
195-
uses: actions/download-artifact@v4
196-
with:
197-
name: libcapture.dylib.arm64
198-
- name: Download Android Capture .dylib.x86_64
199-
uses: actions/download-artifact@v4
200-
with:
201-
name: libcapture.dylib.x86_64
202127
- name: Download Android Example Apps
203128
uses: actions/download-artifact@v4
204129
with:

ci/BUILD.shared_libs

Lines changed: 0 additions & 44 deletions
This file was deleted.

ci/capture_android_release.sh

Lines changed: 37 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ function generate_maven_file() {
3434

3535
echo "+++ Generating maven-metadata.xml for '$location'"
3636

37-
releases=$(aws s3 ls "$location/" \
38-
| grep -v 'maven-metadata.xml' \
39-
| grep -v 'io.bitdrift' \
40-
| awk '{print $2}' \
41-
| sed 's/^\///;s/\/$//')
37+
releases=$(aws s3 ls "$location/" |
38+
grep -v 'maven-metadata.xml' |
39+
grep -v 'io.bitdrift' |
40+
awk '{print $2}' |
41+
sed 's/^\///;s/\/$//')
4242

4343
python3 "$sdk_repo/ci/generate_maven_metadata.py" --releases "${releases//$'\n'/,}" --library "library_name"
4444

@@ -53,33 +53,31 @@ function release_capture_sdk() {
5353

5454
# We get a zip containing:
5555
# * the artifacts named per Maven conventions
56-
# * .tar symbols file containing symbols for the stripped release shared libraries.
57-
# * shared dylib libraries
56+
# * .tar symbols file containing symbols for the release build (e.g., for the .aar).
5857

5958
pushd "$(mktemp -d)"
60-
unzip -o "$sdk_repo/$capture_archive"
59+
unzip -o "$sdk_repo/$capture_archive"
6160

62-
echo "+++ Uploading artifacts to s3 bucket"
61+
echo "+++ Uploading artifacts to s3 bucket"
6362

64-
local -r remote_location_prefix="$remote_location_root_prefix/capture"
65-
local -r name="capture-$version"
63+
local -r remote_location_prefix="$remote_location_root_prefix/capture"
64+
local -r name="capture-$version"
6665

67-
files=(\
68-
"$sdk_repo/ci/LICENSE.txt" \
69-
"$sdk_repo/ci/NOTICE.txt" \
70-
"$name.pom" \
71-
"$name-javadoc.jar" \
72-
"$name-sources.jar" \
73-
"$name-symbols.tar" \
74-
"$name-dylib.tar" \
75-
"$name.aar" \
76-
)
66+
files=(
67+
"$sdk_repo/ci/LICENSE.txt"
68+
"$sdk_repo/ci/NOTICE.txt"
69+
"$name.pom"
70+
"$name-javadoc.jar"
71+
"$name-sources.jar"
72+
"$name-symbols.tar"
73+
"$name.aar"
74+
)
7775

78-
for file in "${files[@]}"; do
79-
upload_file "$remote_location_prefix/$version" "$file"
80-
done
76+
for file in "${files[@]}"; do
77+
upload_file "$remote_location_prefix/$version" "$file"
78+
done
8179

82-
generate_maven_file "$remote_location_prefix" "capture"
80+
generate_maven_file "$remote_location_prefix" "capture"
8381
popd
8482
}
8583

@@ -92,16 +90,16 @@ function release_gradle_library() {
9290
local -r remote_location_prefix="$remote_location_root_prefix/$library_name"
9391

9492
pushd "$(mktemp -d)"
95-
unzip -o "$sdk_repo/$archive"
96-
97-
# Update the per-version files
98-
aws s3 cp "$sdk_repo/ci/LICENSE.txt" "$remote_location_prefix/$version/LICENSE.txt" --region us-east-1
99-
aws s3 cp "$sdk_repo/ci/NOTICE.txt" "$remote_location_prefix/$version/NOTICE.txt" --region us-east-1
93+
unzip -o "$sdk_repo/$archive"
94+
95+
# Update the per-version files
96+
aws s3 cp "$sdk_repo/ci/LICENSE.txt" "$remote_location_prefix/$version/LICENSE.txt" --region us-east-1
97+
aws s3 cp "$sdk_repo/ci/NOTICE.txt" "$remote_location_prefix/$version/NOTICE.txt" --region us-east-1
10098

101-
# Upload all the files in the zip
102-
aws s3 cp . "$remote_location_prefix/$version/" --recursive --region us-east-1
99+
# Upload all the files in the zip
100+
aws s3 cp . "$remote_location_prefix/$version/" --recursive --region us-east-1
103101

104-
generate_maven_file "$remote_location_prefix" "$library_name"
102+
generate_maven_file "$remote_location_prefix" "$library_name"
105103
popd
106104
}
107105

@@ -115,15 +113,15 @@ function release_gradle_plugin() {
115113
local -r remote_location_prefix="$remote_location_root_prefix/$plugin_name/$plugin_marker"
116114

117115
pushd "$(mktemp -d)"
118-
unzip -o "$sdk_repo/$archive"
116+
unzip -o "$sdk_repo/$archive"
119117

120-
aws s3 cp "$sdk_repo/ci/LICENSE.txt" "$remote_location_prefix/$version/LICENSE.txt" --region us-east-1
121-
aws s3 cp "$sdk_repo/ci/NOTICE.txt" "$remote_location_prefix/$version/NOTICE.txt" --region us-east-1
118+
aws s3 cp "$sdk_repo/ci/LICENSE.txt" "$remote_location_prefix/$version/LICENSE.txt" --region us-east-1
119+
aws s3 cp "$sdk_repo/ci/NOTICE.txt" "$remote_location_prefix/$version/NOTICE.txt" --region us-east-1
122120

123-
aws s3 cp . "$remote_location_prefix/$version/" --recursive --region us-east-1
121+
aws s3 cp . "$remote_location_prefix/$version/" --recursive --region us-east-1
124122

125-
generate_maven_file "$remote_location_prefix" "$plugin_marker"
126-
popd
123+
generate_maven_file "$remote_location_prefix" "$plugin_marker"
124+
popd
127125
}
128126

129127
release_capture_sdk

ci/gh_prepare_android_artifacts.sh

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10,33 +10,17 @@ function prepare_capture_sdk() {
1010
echo "+++ Preparing Android Capture SDK artifacts for '$version' version"
1111

1212
pushd "$(mktemp -d)"
13-
local -r out_artifacts_dir="android-tmp"
14-
readonly dylibs_dir="capture-$version-dylib"
13+
local -r out_artifacts_dir="android-tmp"
1514

16-
mkdir "$out_artifacts_dir"
17-
mkdir "$dylibs_dir/"
18-
mkdir "$dylibs_dir/darwin_arm64/"
19-
mkdir "$dylibs_dir/darwin_x86_64/"
15+
mkdir "$out_artifacts_dir"
2016

21-
echo "++ Creating shared dylibs"
17+
echo "++ Unzipping Maven Android artifacts"
2218

23-
mv "$sdk_repo/libcapture.dylib.arm64" "$dylibs_dir/darwin_arm64/libcapture.dylib"
24-
mv "$sdk_repo/libcapture.dylib.x86_64" "$dylibs_dir/darwin_x86_64/libcapture.dylib"
25-
mv "$sdk_repo/libcapture.so" "$dylibs_dir/"
19+
unzip "$sdk_repo/Capture.android.zip" -d "$out_artifacts_dir"
2620

27-
cp "$sdk_repo/ci/BUILD.shared_libs" "$dylibs_dir"/BUILD
21+
echo "++ Creating Android artifacts zip"
2822

29-
pushd "$dylibs_dir"
30-
tar cvf "../$out_artifacts_dir/$dylibs_dir.tar" ./*
31-
popd
32-
33-
echo "++ Unzipping Maven Android artifacts"
34-
35-
unzip "$sdk_repo/Capture.android.zip" -d "$out_artifacts_dir"
36-
37-
echo "++ Creating Android artifacts zip"
38-
39-
(cd "$out_artifacts_dir" && zip -r "$sdk_repo/Capture-$version.android.zip" ./*)
23+
(cd "$out_artifacts_dir" && zip -r "$sdk_repo/Capture-$version.android.zip" ./*)
4024
popd
4125
}
4226

0 commit comments

Comments
 (0)