Add a surrealdb-next release train (#3888)

This commit is contained in:
Rushmore Mushambi 2024-05-10 11:05:32 +02:00 committed by GitHub
parent 1d441e1c21
commit 24ae06051e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 80 additions and 19 deletions

39
.github/workflows/next.yml vendored Normal file
View file

@ -0,0 +1,39 @@
# This workflow triggers next releases
name: Next release
run-name: "Next release '${{ inputs.git-ref || github.ref_name }}' (publish: ${{ inputs.publish || github.event_name == 'schedule' }})"
on:
workflow_dispatch:
inputs:
git-ref:
required: true
type: string
description: "The github ref of this next version (i.e. main, 1234567)"
default: main
publish:
required: false
type: boolean
default: false
description: "Publish the next release"
schedule:
- cron: '0 0 * * *'
defaults:
run:
shell: bash
permissions:
contents: write
jobs:
release:
name: Prepare next release
uses: ./.github/workflows/reusable_publish_version.yml
with:
environment: next
extra-features: storage-surrealkv
git-ref: ${{ inputs.git-ref || github.ref_name }}
publish: ${{ inputs.publish || github.event_name == 'schedule' }}
secrets: inherit

View file

@ -4,7 +4,7 @@ on:
environment:
required: true
type: string
description: "The name of this release environment. It can be a 'nightly', 'beta' or 'release'"
description: "The name of this release environment. It can be 'next', 'nightly', 'beta' or 'stable'"
git-ref:
required: true
type: string
@ -190,7 +190,7 @@ jobs:
echo "git-ref=${{ inputs.git-ref }}" >> $GITHUB_OUTPUT
fi
if [[ "${{ inputs.environment }}" == "nightly" ]]; then
if [[ "${{ inputs.environment }}" == "nightly" || "${{ inputs.environment }}" == "next" ]]; then
echo "name=${{ inputs.environment }}" >> $GITHUB_OUTPUT
date=$(git show --no-patch --format=%ad --date=format:%Y%m%d)
@ -562,7 +562,7 @@ jobs:
sudo chmod +x /usr/bin/release-plz
- name: Install a TOML parser
if: ${{ inputs.environment == 'nightly' || inputs.environment == 'beta' }}
if: ${{ inputs.environment != 'stable' }}
run: |
curl -L https://github.com/tamasfe/taplo/releases/download/0.8.1/taplo-full-linux-x86_64.gz | gunzip - > taplo
chmod +x taplo
@ -601,6 +601,8 @@ jobs:
- name: Patch nightly crate version
if: ${{ inputs.environment == 'nightly' }}
run: |
set -x
# Get the date of the last commit
date=$(git show --no-patch --format=%ad --date=format:%Y%m%d)
@ -608,16 +610,36 @@ jobs:
currentVersion=$(taplo get -f Cargo.toml "package.version")
major=$(echo $currentVersion | tr "." "\n" | sed -n 1p)
minor=$(echo $currentVersion | tr "." "\n" | sed -n 2p)
# This sets the nightly version to something like `1.3.20231117`
# This sets the nightly and next version to something like `1.3.20231117`
version=${major}.${minor}.${date}
# Update the version to a nightly one
# Update the version to a nightly or next one
sed -i "s#^version = \".*\"#version = \"${version}\"#" lib/Cargo.toml
sed -i "s#^version = \".*\"#version = \"2.0.0-${version}\"#" core/Cargo.toml
sed -i "s#surrealdb-core2 = { version = \"=2.0.0-${currentVersion}\"#surrealdb-core2 = { version = \"=2.0.0-${version}\"#" lib/Cargo.toml
- name: Patch next crate version
if: ${{ inputs.environment == 'next' }}
run: |
set -x
# Get the date of the last commit
date=$(git show --no-patch --format=%ad --date=format:%Y%m%d)
# Derive crate version
currentVersion=$(taplo get -f Cargo.toml "package.version")
major=$(echo $currentVersion | tr "." "\n" | sed -n 1p)
minor=$(echo $currentVersion | tr "." "\n" | sed -n 2p)
# This sets the nightly and next version to something like `1.3.20231117`
version=${major}.${minor}.${date}
# Update the version to a nightly or next one
sed -i "s#^version = \".*\"#version = \"${version}\"#" lib/Cargo.toml
sed -i "s#^version = \".*\"#version = \"${version}\"#" core/Cargo.toml
sed -i "s#surrealdb-core = { version = \"${major}\"#surrealdb-core = { version = \"=${version}\"#" lib/Cargo.toml
- name: Patch crate name and description
if: ${{ inputs.environment == 'nightly' || inputs.environment == 'beta' }}
if: ${{ inputs.environment != 'stable' }}
run: |
set -x
@ -654,7 +676,7 @@ jobs:
with:
name: "Release ${{ needs.prepare-vars.outputs.git-ref }}"
tag_name: ${{ needs.prepare-vars.outputs.git-ref }}
prerelease: ${{ inputs.environment == 'beta' || inputs.environment == 'nightly' }}
prerelease: ${{ inputs.environment != 'stable' }}
fail_on_unmatched_files: true
files: |
LICENSE

6
Cargo.lock generated
View file

@ -5819,7 +5819,7 @@ checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc"
[[package]]
name = "surreal"
version = "1.5.0"
version = "2.0.0"
dependencies = [
"argon2",
"assert_fs",
@ -5882,7 +5882,7 @@ dependencies = [
[[package]]
name = "surrealdb"
version = "1.5.0"
version = "2.0.0"
dependencies = [
"async-channel 1.9.0",
"bincode",
@ -5937,7 +5937,7 @@ dependencies = [
[[package]]
name = "surrealdb-core"
version = "2.0.0-1.5.0"
version = "2.0.0"
dependencies = [
"addr",
"ahash 0.8.11",

View file

@ -2,7 +2,7 @@
name = "surreal"
publish = false
edition = "2021"
version = "1.5.0"
version = "2.0.0"
license-file = "LICENSE"
authors = ["Tobie Morgan Hitchcock <tobie@surrealdb.com>"]
@ -90,10 +90,10 @@ semver = "1.0.20"
serde = { version = "1.0.193", features = ["derive"] }
serde_json = "1.0.108"
serde_pack = { version = "1.1.2", package = "rmp-serde" }
surrealdb = { version = "1", path = "lib", features = [
"protocol-http",
"protocol-ws",
"rustls",
surrealdb = { version = "2", path = "lib", features = [
"protocol-http",
"protocol-ws",
"rustls",
] }
tempfile = "3.8.1"
thiserror = "1.0.50"

View file

@ -2,7 +2,7 @@
name = "surrealdb-core"
publish = true
edition = "2021"
version = "2.0.0-1.5.0"
version = "2.0.0"
rust-version = "1.77.0"
readme = "../lib/CARGO.md"
authors = ["Tobie Morgan Hitchcock <tobie@surrealdb.com>"]

View file

@ -2,7 +2,7 @@
name = "surrealdb"
publish = true
edition = "2021"
version = "1.5.0"
version = "2.0.0"
rust-version = "1.77.0"
readme = "CARGO.md"
authors = ["Tobie Morgan Hitchcock <tobie@surrealdb.com>"]
@ -104,7 +104,7 @@ rustls = { version = "0.21.11", optional = true }
semver = { version = "1.0.20", features = ["serde"] }
serde = { version = "1.0.193", features = ["derive"] }
serde_json = "1.0.108"
surrealdb-core = { version = "=2.0.0-1.5.0", default-features = false, path = "../core" }
surrealdb-core = { version = "2", default-features = false, path = "../core", package = "surrealdb-core" }
thiserror = "1.0.50"
tokio-util = { version = "0.7.10", optional = true, features = ["compat"] }
tracing = "0.1.40"

View file

@ -37,7 +37,7 @@ pub type Result<T> = std::result::Result<T, crate::Error>;
// Channel for waiters
type Waiter = (watch::Sender<Option<WaitFor>>, watch::Receiver<Option<WaitFor>>);
const SUPPORTED_VERSIONS: (&str, &str) = (">=1.0.0, <2.0.0", "20230701.55918b7c");
const SUPPORTED_VERSIONS: (&str, &str) = (">=1.0.0, <3.0.0", "20230701.55918b7c");
const REVISION_SUPPORTED_SERVER_VERSION: Version = Version::new(1, 2, 0);
/// Connection trait implemented by supported engines