-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Validate generated
release.tar.gz
on CI (#1681)
- Loading branch information
1 parent
b1e6c20
commit adf3500
Showing
3 changed files
with
45 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
|
||
cd "$BUILD_WORKSPACE_DIRECTORY" | ||
|
||
# Go to parent directory and create a release archive | ||
echo | ||
echo "Changing to parent directory" | ||
pushd "../../" > /dev/null | ||
echo "Building release.tar.gz" | ||
echo | ||
bazel --output_base=setup-bazel-output-base build //distribution:release | ||
|
||
archive_path="$(bazel --output_base=setup-bazel-output-base info output_path)/darwin_arm64-opt/bin/distribution/release.tar.gz" | ||
integrity="sha256-$(cut -d' ' -f 1 $archive_path.sha256 | xxd -r -p | openssl base64 -A)" | ||
|
||
echo | ||
echo "archive_path: $archive_path" | ||
echo "integrity: $integrity" | ||
|
||
# Adjust MODULE.bazel to point to the release archive | ||
echo | ||
echo "Changing back to root directory" | ||
popd > /dev/null | ||
|
||
echo "Adjusting MODULE.bazel to point to release.tar.gz" | ||
perl -i -p0e \ | ||
"s|local_path_override\(\s*module_name = \"rules_xcodeproj\",\n\s*path.*|archive_override(\n module_name = \"rules_xcodeproj\",\n integrity = \"$integrity\",\n urls = [\"file://$archive_path\"],|" \ | ||
MODULE.bazel |