-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Create scripts * Fix script * Run scripts in CI and fix publish = false Signed-off-by: Filippo Costa <[email protected]> * Fix release notes Signed-off-by: Filippo Costa <[email protected]> --------- Signed-off-by: Filippo Costa <[email protected]>
- Loading branch information
Showing
17 changed files
with
162 additions
and
82 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,23 @@ | ||
name: "Pre-release checks" | ||
on: | ||
schedule: | ||
# At 10:00am UTC every Monday. | ||
# See: | ||
# - https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule | ||
# - https://crontab.guru/ | ||
- cron: "0 10 * * 1" | ||
# Allow manual triggering: <https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#workflow_dispatch>. | ||
workflow_dispatch: | ||
# Anytime a PR modifies the list of packages to publish. | ||
pull_request: | ||
paths: | ||
- "packages_to_publish.yml" | ||
|
||
jobs: | ||
check-missing-dependency-versions: | ||
runs-on: buildjet-4vcpu-ubuntu-2204 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- run: ./scripts/check_missing_dependency_versions.sh | ||
shell: bash | ||
working-directory: . |
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
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
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
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 was deleted.
Oops, something went wrong.
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,23 @@ | ||
- sov-rollup-interface | ||
- sov-first-read-last-write-cache | ||
- sov-schema-db | ||
- sov-db | ||
- sov-sequencer | ||
- sov-zk-cycle-macros | ||
- sov-zk-cycle-utils | ||
- sov-state | ||
- sov-modules-macros | ||
- sov-modules-api | ||
- sov-modules-stf-template | ||
|
||
# Modules | ||
- sov-accounts | ||
- sov-bank | ||
- sov-sequencer-registry | ||
- sov-prover-incentives | ||
- sov-chain-state | ||
- sov-blob-storage | ||
|
||
# Adapters | ||
- sov-risc0-adapter | ||
# TODO: sov-celestia-adapter (https://github.com/Sovereign-Labs/nmt-rs/issues/17) |
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,27 @@ | ||
#!/usr/bin/env bash | ||
|
||
# `cargo-publish` requires all dependencies to have a version specified (e.g. it | ||
# can't be sourced from `git` of `path` alone). This script checks that all | ||
# packages we intend to publish have a version specified in their `Cargo.toml` for all | ||
# dependencies. | ||
|
||
set -Euo pipefail | ||
|
||
yq '.[]' packages_to_publish.yml | while read -r pkg; do | ||
echo "Checking crate $pkg..." | ||
|
||
output=$(cargo publish --allow-dirty --dry-run -p "$pkg") | ||
|
||
# Check if the output contains the error message we're looking for. | ||
# | ||
# `cargo publish` may fail for many other reasons, but it'd be too | ||
# hard to reason about them all. This is the only one we can expect | ||
# to catch reliably. | ||
echo "$output" | grep -q "all dependencies must have a version specified when publishing." | ||
if [ $? -eq 0 ]; then | ||
echo "Error: Found problematic output for crate $pkg." | ||
exit 1 | ||
fi | ||
done | ||
|
||
echo "All crates processed successfully." |
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,57 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -Euo pipefail | ||
|
||
# This script makes sure that all workspace crates that are marked as releasable | ||
# are also listed in packages_to_publish.yml. In addition, it makes sure that | ||
# all packages listed in packages_to_publish.yml have all basic crate metadata and don't | ||
# generate warnings when packaged. | ||
# | ||
# Important: this script is assumed to be cheap to run by our GH Actions | ||
# workflows. Create another script if you need to add checks that are more expensive. | ||
|
||
# Somewhat unintuitively, `cargo metadata` returns `"publish": null` for publishable packages. | ||
# From the docs at https://doc.rust-lang.org/cargo/commands/cargo-metadata.html#output-format: | ||
# /* List of registries to which this package may be published. | ||
# Publishing is unrestricted if null, and forbidden if an empty array. */ | ||
releasable_packages=$(cargo metadata --format-version 1 --no-deps | jq -r '.packages[] | select(.publish == null) | .name') | ||
|
||
echo "Releasable packages according to cargo-metadata:" | ||
echo "$releasable_packages" | sed 's/^/- /' | ||
echo "" | ||
|
||
echo "Releasable packages according to packages_to_publish.yml:" | ||
yq '.[]' packages_to_publish.yml | sed 's/^/- /' | ||
echo "" | ||
|
||
echo "Validating packages_to_publish.yml..." | ||
|
||
status=0 | ||
while read -r pkg; do | ||
if yq -e "[\"$pkg\"] - . | length == 1" packages_to_publish.yml > /dev/null 2>&1; then | ||
printf "%40s | ERR is releasable but NOT found in packages_to_publish.yml\n" "$pkg" | ||
status=1 | ||
fi | ||
done <<< "$releasable_packages" | ||
|
||
echo "" | ||
echo "Validating the present of package metadata for all packages_to_publish.yml entries..." | ||
|
||
while read -r pkg; do | ||
# Capture both stdour and stderr. | ||
output=$(cargo package --allow-dirty -p $pkg --list 2>&1) | ||
if echo "$output" | grep -q "warning:"; then | ||
printf "%40s | ERR warnings found:\n" "$pkg" | ||
echo "$output" | grep "warning:" | ||
status=1 | ||
fi | ||
done < <(yq '.[]' packages_to_publish.yml) | ||
|
||
echo "" | ||
if [ $status -eq 1 ]; then | ||
echo "Validation failed." | ||
exit 1 | ||
fi | ||
|
||
echo "Validation successful, everything okay." | ||
echo "Goodbye!" |