Fix the nightly channel (#3012)

This commit is contained in:
Rushmore Mushambi 2023-11-21 15:24:59 +02:00 committed by GitHub
parent 12b591fa09
commit 468d72ff81
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 91 deletions

View file

@ -224,16 +224,18 @@ jobs:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
shell: bash
run: |
# Change `surrealdb` crate name to `surrealdb-nightly`
git apply .patches/surrealdb-nightly.patch
# Replace the crate name
# We are just going to replace the first occurance of surrealdb
sed -i "0,/surrealdb/s//surrealdb-nightly/" lib/Cargo.toml
# Get the date and time of the last commit
date=$(git show --no-patch --format=%ad --date=format:%Y%m%d)
time=$(git show --no-patch --format=%ad --date=format:%H%M%S)
# Update the version to a nightly one
# This sets the nightly version to something like `1.20231117.130416`
sed -i "s#^version = \"\([[:digit:]]*\)\..*\"#version = \"\1.${date}.${time}\"#" lib/Cargo.toml
# This sets the nightly version to something like `1.20231117.1130416`
# The 1 at the beginning of the patch number is just so it never starts with zero
sed -i "s#^version = \"\([[:digit:]]*\)\..*\"#version = \"\1.${date}.1${time}\"#" lib/Cargo.toml
# Get the short commit
shortRev=$(git rev-parse --short HEAD)
@ -241,15 +243,11 @@ jobs:
# Update the description
sed -i "s#^description = \".*\"#description = \"A nightly release of the surrealdb crate based on commit ${shortRev}\"#" lib/Cargo.toml
# Configure release-plz
cp -v .patches/release-nightly-plz.toml release-plz.toml
# Commit changes
# We are not going to push these changes. We do this because
# some git commands `release-plz` runs do not work in detached state.
git config --local user.email "actions@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add release-plz.toml
git commit -am 'Prepare nightly release'
git checkout -b nightly
@ -257,7 +255,7 @@ jobs:
cargo install --force --locked --version 0.3.30 release-plz
# Publish cargo crate
/home/runner/.cargo/bin/release-plz release
/home/runner/.cargo/bin/release-plz release --config .config/release-nightly-plz.toml
docker:
name: Build and publish Docker image

View file

@ -1,82 +0,0 @@
commit 1dcd4e78a3c3e7d9cc73f421080106cfa9aef8a8
Author: Rushmore Mushambi <rushmore@surrealdb.com>
Date: Fri Nov 17 12:06:02 2023 +0200
Rename surrealdb crate to surrealdb-nightly
diff --git a/Cargo.toml b/Cargo.toml
index 55b05199..1bcaab5d 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -9,13 +9,13 @@ authors = ["Tobie Morgan Hitchcock <tobie@surrealdb.com>"]
[features]
# Public features
default = ["storage-mem", "storage-rocksdb", "scripting", "http"]
-storage-mem = ["surrealdb/kv-mem", "has-storage"]
-storage-rocksdb = ["surrealdb/kv-rocksdb", "has-storage"]
-storage-speedb = ["surrealdb/kv-speedb", "has-storage"]
-storage-tikv = ["surrealdb/kv-tikv", "has-storage"]
-storage-fdb = ["surrealdb/kv-fdb-7_1", "has-storage"]
-scripting = ["surrealdb/scripting"]
-http = ["surrealdb/http"]
+storage-mem = ["surrealdb-nightly/kv-mem", "has-storage"]
+storage-rocksdb = ["surrealdb-nightly/kv-rocksdb", "has-storage"]
+storage-speedb = ["surrealdb-nightly/kv-speedb", "has-storage"]
+storage-tikv = ["surrealdb-nightly/kv-tikv", "has-storage"]
+storage-fdb = ["surrealdb-nightly/kv-fdb-7_1", "has-storage"]
+scripting = ["surrealdb-nightly/scripting"]
+http = ["surrealdb-nightly/http"]
http-compression = []
# Private features
has-storage = []
@@ -60,7 +60,7 @@ serde = { version = "1.0.183", features = ["derive"] }
serde_cbor = "0.11.2"
serde_json = "1.0.104"
serde_pack = { version = "1.1.2", package = "rmp-serde" }
-surrealdb = { path = "lib", features = ["protocol-http", "protocol-ws", "rustls"] }
+surrealdb-nightly = { path = "lib", features = ["protocol-http", "protocol-ws", "rustls"] }
tempfile = "3.7.1"
thiserror = "1.0.44"
tokio = { version = "1.31.0", features = ["macros", "signal"] }
diff --git a/lib/Cargo.toml b/lib/Cargo.toml
index 6bbdeb53..da9c7530 100644
--- a/lib/Cargo.toml
+++ b/lib/Cargo.toml
@@ -1,5 +1,5 @@
[package]
-name = "surrealdb"
+name = "surrealdb-nightly"
publish = true
edition = "2021"
version = "1.0.0"
@@ -143,6 +143,7 @@ uuid = { version = "1.4.1", features = ["serde", "v4", "v7"] }
[lib]
bench = false
+name = "surrealdb"
[[bench]]
name = "executor"
diff --git a/lib/examples/actix/Cargo.toml b/lib/examples/actix/Cargo.toml
index 8287a2f1..001e79e4 100644
--- a/lib/examples/actix/Cargo.toml
+++ b/lib/examples/actix/Cargo.toml
@@ -8,5 +8,5 @@ publish = false
actix-web = { version = "4.3.1", features = ["macros"] }
once_cell = "1.18.0"
serde = { version = "1.0.183", features = ["derive"] }
-surrealdb = { path = "../.." }
+surrealdb-nightly = { path = "../.." }
thiserror = "1.0.44"
diff --git a/lib/examples/axum/Cargo.toml b/lib/examples/axum/Cargo.toml
index 75aaf04f..7a72847c 100644
--- a/lib/examples/axum/Cargo.toml
+++ b/lib/examples/axum/Cargo.toml
@@ -7,6 +7,6 @@ publish = false
[dependencies]
axum = "0.6.20"
serde = { version = "1.0.183", features = ["derive"] }
-surrealdb = { path = "../.." }
+surrealdb-nightly = { path = "../.." }
thiserror = "1.0.44"
tokio = { version = "1.31.0", features = ["macros", "rt-multi-thread"] }

View file

@ -144,6 +144,7 @@ tokio-tungstenite = { version = "0.20.1", optional = true }
uuid = { version = "1.6.1", features = ["serde", "v4", "v7"] }
[lib]
name = "surrealdb" # Needed for the nightly crate as we will be renaming it
bench = false
[[bench]]