mirror of
https://github.com/leptos-rs/leptos.git
synced 2025-12-27 07:34:35 -05:00
fix: semver and feature handy script for update nightly (#3674)
This commit is contained in:
4
.github/workflows/ci-semver.yml
vendored
4
.github/workflows/ci-semver.yml
vendored
@@ -18,7 +18,7 @@ jobs:
|
||||
test:
|
||||
needs: [get-leptos-changed]
|
||||
if: needs.get-leptos-changed.outputs.leptos_changed == 'true' && github.event.pull_request.labels[0].name != 'breaking'
|
||||
name: Run semver check (nightly-2025-02-19)
|
||||
name: Run semver check (nightly-2025-03-05)
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Install Glib
|
||||
@@ -30,4 +30,4 @@ jobs:
|
||||
- name: Semver Checks
|
||||
uses: obi1kenobi/cargo-semver-checks-action@v2
|
||||
with:
|
||||
rust-toolchain: nightly-2025-02-19
|
||||
rust-toolchain: nightly-2025-03-05
|
||||
|
||||
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@@ -26,4 +26,4 @@ jobs:
|
||||
with:
|
||||
directory: ${{ matrix.directory }}
|
||||
cargo_make_task: "ci"
|
||||
toolchain: nightly-2025-02-19
|
||||
toolchain: nightly-2025-03-05
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
[toolchain]
|
||||
channel = "nightly-2024-01-29"
|
||||
channel = "nightly-2025-03-05"
|
||||
|
||||
@@ -11,13 +11,13 @@ dependencies = [
|
||||
[tasks.test-leptos_macro-example]
|
||||
description = "Tests the leptos_macro/example to check if macro handles doc comments correctly"
|
||||
command = "cargo"
|
||||
args = ["+nightly-2025-02-19", "test", "--doc"]
|
||||
args = ["+nightly-2025-03-05", "test", "--doc"]
|
||||
cwd = "example"
|
||||
install_crate = false
|
||||
|
||||
[tasks.doc-leptos_macro-example]
|
||||
description = "Docs the leptos_macro/example to check if macro handles doc comments correctly"
|
||||
command = "cargo"
|
||||
args = ["+nightly-2025-02-19", "doc"]
|
||||
args = ["+nightly-2025-03-05", "doc"]
|
||||
cwd = "example"
|
||||
install_crate = false
|
||||
|
||||
45
scripts/update_nightly.sh
Executable file
45
scripts/update_nightly.sh
Executable file
@@ -0,0 +1,45 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
exit_error() {
|
||||
echo "ERROR: $1" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
current_dir=$(pwd)
|
||||
|
||||
if [[ "$current_dir" != */leptos ]]; then
|
||||
exit_error "Current directory does not end with leptos"
|
||||
fi
|
||||
|
||||
# Check if a date is provided as an argument
|
||||
if [ $# -eq 1 ]; then
|
||||
NEW_DATE=$1
|
||||
echo -n "Will use the provided date: "
|
||||
else
|
||||
# Use current date if no date is provided
|
||||
NEW_DATE=$(date +"%Y-%m-%d")
|
||||
echo -n "Will use the current date: "
|
||||
fi
|
||||
|
||||
echo "$NEW_DATE"
|
||||
|
||||
# Detect if it is darwin sed
|
||||
if sed --version 2>/dev/null | grep -q GNU; then
|
||||
SED_COMMAND="sed -i"
|
||||
else
|
||||
SED_COMMAND='sed -i ""'
|
||||
fi
|
||||
|
||||
MATCH="nightly-[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]"
|
||||
REPLACE="nightly-$NEW_DATE"
|
||||
|
||||
# Find all occurrences of the pattern
|
||||
git grep -l "$MATCH" | while read -r file; do
|
||||
# Replace the pattern in each file
|
||||
$SED_COMMAND "s/$MATCH/$REPLACE/g" "$file"
|
||||
echo "Updated $file"
|
||||
done
|
||||
|
||||
echo "All occurrences of 'nightly-XXXX-XX-XX' have been replaced with 'nightly-$NEW_DATE'"
|
||||
Reference in New Issue
Block a user