-
Notifications
You must be signed in to change notification settings - Fork 17
added script and doc to automate release in the future #33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
aslam9691
wants to merge
10
commits into
firebase:main
Choose a base branch
from
aslam9691:syncup-process
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+103
−0
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
f45cbd0
added script and doc to automate release in the future
aslam9691 1349f8c
Update scripts/sync-upstream.sh
aslam9691 e595735
Update scripts/sync-upstream.sh
aslam9691 cbe5ed0
Update scripts/sync-upstream.sh
aslam9691 234bcb6
Update scripts/sync-upstream.sh
aslam9691 20af538
Update docs/syncprocess.md
aslam9691 87881f6
updated docs
aslam9691 8fdafa4
Apply suggestions from code review
aslam9691 9400d40
added script for generating err_data.c
aslam9691 1b57a0d
added missing file
aslam9691 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,14 @@ | ||
| ## Syncing with Upstream | ||
| To sync this repository with the upstream google/boringssl repository while maintaining the lightweight SwiftPM structure: | ||
|
|
||
| 1. Ensure Upstream Remote is Configured: | ||
| git remote add upstream https://github.com/google/boringssl | ||
|
|
||
| 2. Run the Sync Script: | ||
| Execute the automation script from the root directory: | ||
|
|
||
| ``` | ||
| ./scripts/sync-upstream.sh [commit-hash] | ||
| ``` | ||
| If no commit-hash is provided, it defaults to upstream/main. | ||
|
|
This file contains hidden or 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,10 @@ | ||
| #!/bin/bash | ||
| set -e | ||
|
|
||
| # Move to repository root | ||
| cd "$(dirname "$0")/.." | ||
|
|
||
| echo "--- Generating err_data.c ---" | ||
| go run ./util/pregenerate err_data.cc | ||
| cp -f gen/crypto/err_data.cc ./err_data.c | ||
| echo "SUCCESS: err_data.c generated and copied to root folder." |
This file contains hidden or 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,79 @@ | ||
| #!/bin/bash | ||
| set -e | ||
|
|
||
| # Usage: ./scripts/sync-upstream.sh [commit-hash] | ||
| COMMIT_HASH=${1:-upstream/main} | ||
| TEMP_DIR=$(mktemp -d) | ||
| trap 'rm -rf "$TEMP_DIR"' EXIT | ||
|
|
||
| # 1. Define the files/folders you want to preserve | ||
| # Ensure these paths are relative to the repository root | ||
| PRESERVE=( | ||
| "Package.swift" | ||
| "PrivacyInfo.xcprivacy" | ||
| "README.md" | ||
| "scripts" | ||
| "docs" | ||
| ".github" | ||
| "SwiftPMTests" | ||
| ) | ||
|
aslam9691 marked this conversation as resolved.
|
||
|
|
||
| echo "--- Preserving local files ---" | ||
| for file in "${PRESERVE[@]}"; do | ||
| if [ -e "$file" ]; then | ||
| cp -r "$file" "$TEMP_DIR/" | ||
| fi | ||
| done | ||
|
|
||
| # 2. Fetch and reset | ||
| echo "--- Syncing to: $COMMIT_HASH ---" | ||
| if ! git remote | grep -q "^upstream$"; then | ||
| echo "ERROR: 'upstream' remote is not configured." | ||
| echo "Please run: git remote add upstream https://github.com/google/boringssl" | ||
| exit 1 | ||
| fi | ||
| git fetch upstream | ||
|
aslam9691 marked this conversation as resolved.
|
||
| git reset --hard "$COMMIT_HASH" | ||
|
|
||
| # 3. Restore preserved files | ||
| echo "--- Restoring local files ---" | ||
| for file in "${PRESERVE[@]}"; do | ||
| clean_file="${file%/}" | ||
| target_name=$(basename "$clean_file") | ||
| if [ -e "$TEMP_DIR/$target_name" ]; then | ||
| if [ -d "$TEMP_DIR/$target_name" ]; then | ||
| mkdir -p "$clean_file" | ||
| cp -r "$TEMP_DIR/$target_name/." "$clean_file/" | ||
| else | ||
| cp "$TEMP_DIR/$target_name" "$clean_file" | ||
| fi | ||
| fi | ||
| done | ||
|
aslam9691 marked this conversation as resolved.
|
||
|
|
||
| # 4. Generate err_data.c | ||
| bash ./scripts/generate-err-data.sh | ||
|
|
||
| # 5. Cleanup function | ||
| cleanup() { | ||
| echo "--- Performing comprehensive cleanup ---" | ||
|
|
||
| # Directories | ||
| rm -rf rust/ infra/ fuzz/ third_party/googletest/ | ||
| rm -rf third_party/wycheproof_testvectors/ pki/testdata/ gen/test_support/ | ||
| rm -rf .swiftpm/ .bcr/ .build/ | ||
|
|
||
| # Files and artifacts | ||
| find . -type f -not -path "./.git/*" \( -name "*_test.cc" -o -name "*_test.go" -o -name "*_tests.txt" -o -name "*_unittest.cc" \) -delete | ||
| rm -f .bazelrc | ||
| find . -not -path "./.git/*" -name ".DS_Store" -delete | ||
| } | ||
|
|
||
| cleanup | ||
|
|
||
| echo "--- Verifying build ---" | ||
| if swift build; then | ||
| echo "SUCCESS: Build verified." | ||
| else | ||
| echo "ERROR: Build failed." | ||
| exit 1 | ||
| fi | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.