-
Notifications
You must be signed in to change notification settings - Fork 125
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
release-libs.yaml
automatically triggered on PRs to main
#790
Merged
plebhash
merged 17 commits into
stratum-mining:main
from
plebhash:trigger-release-lib-automatically
Apr 3, 2024
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
968582e
release-libs on push to main
plebhash 26b9792
add check-versioning-lib-release.sh
plebhash a305985
avoid files under target dir
plebhash d6ac089
remove roles from release-libs.yaml
plebhash 1f149dc
run check-versioning-lib-release.sh on CI
plebhash abfc5da
fix release-libs.yaml
plebhash e4f8db8
use bash shebang on check-versioning-lib-release.sh
plebhash b57352b
unify jobs
plebhash 32f47ea
fix check-versioning-lib-release.sh
plebhash 8d6e7f1
trigger release-libs.yaml on pull_requests to main
plebhash 475cdd6
checkout main on release-libs.yaml
plebhash f887e3d
revert checkout main on release-libs.yaml
plebhash c5bf950
fetch main and dev branches
plebhash 9111157
trigger release-libs.yaml on pull_requests to main
plebhash 86c7c10
simplify check-versioning-lib-release.sh
plebhash 2ca3bf0
lint release-libs.yaml
plebhash 52098db
Revert "remove roles from release-libs.yaml"
plebhash 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 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,53 @@ | ||
#!/bin/bash | ||
|
||
git fetch origin main | ||
git fetch origin dev | ||
|
||
crates=( | ||
"utils/buffer" | ||
"protocols/v2/binary-sv2/no-serde-sv2/derive_codec" | ||
"protocols/v2/binary-sv2/no-serde-sv2/codec" | ||
"protocols/v2/binary-sv2/serde-sv2" | ||
"protocols/v2/binary-sv2/binary-sv2" | ||
"protocols/v2/const-sv2" | ||
"protocols/v2/framing-sv2" | ||
"protocols/v2/noise-sv2" | ||
"protocols/v2/codec-sv2" | ||
"protocols/v2/subprotocols/common-messages" | ||
"protocols/v2/subprotocols/job-declaration" | ||
"protocols/v2/subprotocols/mining" | ||
"protocols/v2/subprotocols/template-distribution" | ||
"protocols/v2/sv2-ffi" | ||
"protocols/v2/roles-logic-sv2" | ||
"protocols/v1" | ||
"utils/bip32-key-derivation" | ||
"utils/error-handling" | ||
"utils/key-utils" | ||
"roles/roles-utils/network-helpers" | ||
"roles/roles-utils/rpc" | ||
"roles/jd-client" | ||
"roles/jd-server" | ||
"roles/mining-proxy" | ||
"roles/pool" | ||
"roles/translator" | ||
) | ||
|
||
# Loop through each crate | ||
for crate in "${crates[@]}"; do | ||
cd "$crate" | ||
|
||
# Check if there were any changes between dev and main | ||
git diff --quiet "origin/dev" "origin/main" -- . | ||
if [ $? -ne 0 ]; then | ||
|
||
# Check if crate versions on dev and main are identical | ||
version_dev=$(git show origin/dev:./Cargo.toml | awk -F' = ' '$1 == "version" {gsub(/[ "]+/, "", $2); print $2}') | ||
version_main=$(git show origin/main:./Cargo.toml | awk -F' = ' '$1 == "version" {gsub(/[ "]+/, "", $2); print $2}') | ||
if [ "$version_dev" = "$version_main" ]; then | ||
echo "Changes detected in crate $crate between dev and main branches! Versions on dev and main branches are identical ($version_dev), so you should bump the crate version on dev before merging into main." | ||
exit 1 | ||
fi | ||
fi | ||
|
||
cd - >/dev/null | ||
done | ||
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here's an example of how this shell script will prevent us from merging to
main
if we forget to bump some crate's version on a PR fromdev
tomain
:https://github.com/plebhash/stratum/actions/runs/8530384769/job/23368058479?pr=47#step:3:15