Publish crates from repo as is (without version increment) (#35)

This commit is contained in:
folex 2021-05-14 18:07:40 +03:00 committed by GitHub
parent f89113f3e3
commit 3de1d949e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 1838 additions and 81 deletions

View File

@ -26,7 +26,7 @@ jobs:
~/.cargo/bin
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install Rust toolchain with wasm32-unknown-unknown
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
@ -38,50 +38,26 @@ jobs:
command: update
args: --aggressive
### Calculate FINAL_VERSION
- name: Install jq & sponge
run: sudo apt-get update && sudo apt-get --yes --force-yes install jq moreutils
- name: Install jq
run: sudo apt-get update && sudo apt-get --yes --force-yes install jq
- name: Install cargo-show cargo-workspaces toml-cli
run: cargo install cargo-show cargo-workspaces toml-cli || true
- name: Calculate the version
run: |
# install semver and add it to PATH
yarn global add semver
PATH="$(yarn global bin):$PATH"
CARGO_TOML="Cargo.toml"
# get package name from Cargo.toml
PKG_NAME="$(toml get "$CARGO_TOML" package.name | tr -d \")"
# get version from Cargo.toml
LOCAL_VERSION="$(toml get "$CARGO_TOML" package.version | tr -d \")"
# Define accumulator array variable
ALL_CRATES_VERSIONS=()
# For all crates in the workspace accumulate its max_version
for CRATE_NAME in $(cargo ws list)
do
CRATE_VERSION="$((cargo show --json "$CRATE_NAME" | jq -r .crate.max_version) 2>/dev/null || true)"
ALL_CRATES_VERSIONS+=($CRATE_VERSION)
done
# Take the highest version of all
MAX_CRATES_VERSION="$(semver -p ${ALL_CRATES_VERSIONS[@]} | tail -n1 || true)"
# Increment patch octet of the highest version
NEXT_CRATE_VERSION="$(semver --increment patch "${MAX_CRATES_VERSION}" || true)"
# take the highest version
MAX_VERSION="$(semver "$NEXT_CRATE_VERSION" "$LOCAL_VERSION" | tail -n1)"
echo "FINAL_VERSION=$MAX_VERSION" | tee -a $GITHUB_ENV
echo "PKG_NAME=$PKG_NAME" | tee -a $GITHUB_ENV
- name: Install cargo-workspaces
run: cargo install cargo-workspaces || true
### === Rust package release ===
- name: Login to crates.io
run: cargo login ${{ secrets.CRATES_IO_TOKEN }}
- name: Save fluence's crate version to env
run: |
set -x
PKG_NAME=fluence
VERSION=$(cargo ws list -l | grep "$PKG_NAME"$ | head -n1 | awk '{ print $2 }')
echo "VERSION=$VERSION" | tee -a $GITHUB_ENV
echo "PKG_NAME=$PKG_NAME" | tee -a $GITHUB_ENV
- name: Publish to crates.io
run: cargo ws publish --no-git-commit --allow-dirty --yes custom "${{ env.FINAL_VERSION }}"
run: cargo ws publish --no-git-commit --from-git --skip-published --yes
### Create a pre-release
- name: Create Release
@ -90,9 +66,9 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.FINAL_VERSION }}
release_name: Fluence Rust SDK ${{ env.FINAL_VERSION }}
tag_name: ${{ env.VERSION }}
release_name: Fluence Rust SDK ${{ env.VERSION }}
body: |
- [${{ env.FINAL_VERSION }} @ crates.io](https://crates.io/crates/${{ env.PKG_NAME }}/${{ env.FINAL_VERSION }})
- [${{ env.VERSION }} @ crates.io](https://crates.io/crates/${{ env.PKG_NAME }}/${{ env.VERSION }})
draft: false
prerelease: true
prerelease: false

7
.gitignore vendored
View File

@ -1,6 +1,11 @@
# We keep Cargo.lock in the repo even though crates here are meant to be used as libraries. Reasons for that are:
# 1. It makes builds more stable
# 2. It doesn't affect users of the libraries in any way: Cargo.lock isn't included in the package distribution
# 3. If one of the dependencies breaks our build, we can always say when and why that happened
# 4. Since Cargo.lock isn't distributed (which is a good thing), we tend to specify inner dependencies with =x.x.x
# Rust artifacts
target
Cargo.lock
# IDE metadate
.idea

1775
Cargo.lock generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,10 +1,10 @@
[package]
name = "fluence-sdk-main"
version = "0.6.4" # remember to update html_root_url
version = "0.6.8" # remember to update html_root_url
edition = "2018"
description = "Rust SDK for applications for the Fluence network"
documentation = "https://docs.rs/fluence/marine-macro"
repository = "https://github.com/fluencelabs/rust-sdk/crates/main"
documentation = "https://docs.rs/fluence-sdk-main"
repository = "https://github.com/fluencelabs/rust-sdk/tree/master/crates/main"
authors = ["Fluence Labs"]
keywords = ["fluence", "sdk", "webassembly"]
categories = ["api-bindings", "wasm"]
@ -19,7 +19,7 @@ crate-type = ["rlib"]
doctest = false
[dependencies]
marine-macro = { path = "../marine-macro", version = "=0.6.4" }
marine-macro = { path = "../marine-macro", version = "=0.6.8" }
log = { version = "0.4.8", features = ["std"] }
serde = "=1.0.118"

View File

@ -19,7 +19,7 @@
#![allow(clippy::missing_safety_doc)]
#![allow(clippy::needless_doctest_main)]
#![doc(html_root_url = "https://docs.rs/fluence-sdk-main/0.5.0")]
#![doc(html_root_url = "https://docs.rs/fluence-sdk-main/0.6.8")]
#![deny(
dead_code,
nonstandard_style,

View File

@ -1,10 +1,10 @@
[package]
name = "marine-macro-impl"
version = "0.6.4" # remember to update html_root_url
version = "0.6.8" # remember to update html_root_url
edition = "2018"
description = "Implementation of the `#[marine]` macro"
documentation = "https://docs.rs/fluence/marine-macro"
repository = "https://github.com/fluencelabs/rust-sdk/crates/macro"
documentation = "https://docs.rs/fluence/marine-macro-impl"
repository = "https://github.com/fluencelabs/rust-sdk/tree/master/crates/marine-macro-impl"
authors = ["Fluence Labs"]
keywords = ["fluence", "sdk", "webassembly", "it", "interface-types"]
categories = ["api-bindings", "wasm"]

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
#![doc(html_root_url = "https://docs.rs/marine-macro-impl/0.6.2")]
#![doc(html_root_url = "https://docs.rs/marine-macro-impl/0.6.8")]
#![deny(
dead_code,
nonstandard_style,

View File

@ -1,10 +1,10 @@
[package]
name = "marine-macro"
version = "0.6.4" # remember to update html_root_url
version = "0.6.8" # remember to update html_root_url
edition = "2018"
description = "Definition of the `#[marine]` macro"
documentation = "https://docs.rs/fluence/marine-macro"
repository = "https://github.com/fluencelabs/rust-sdk/crates/macro"
repository = "https://github.com/fluencelabs/rust-sdk/tree/master/crates/marine-macro"
authors = ["Fluence Labs"]
keywords = ["fluence", "sdk", "webassembly", "procedural_macros"]
categories = ["api-bindings", "wasm"]
@ -18,4 +18,4 @@ proc-macro = true
doctest = false
[dependencies]
marine-macro-impl = { path = "../marine-macro-impl", version = "=0.6.4" }
marine-macro-impl = { path = "../marine-macro-impl", version = "=0.6.8" }

View File

@ -50,7 +50,7 @@
//!
//! ```
#![doc(html_root_url = "https://docs.rs/marine-macro/0.5.0")]
#![doc(html_root_url = "https://docs.rs/marine-macro/0.6.8")]
#![deny(
dead_code,
nonstandard_style,

View File

@ -1,12 +1,13 @@
[package]
name = "marine-test-macro-impl"
version = "0.1.5" # remember to update html_root_url
version = "0.1.8" # remember to update html_root_url
edition = "2018"
description = "Implementation of the `#[marine_test]` macro"
repository = "https://github.com/fluencelabs/rust-sdk/crates/macro-test"
documentation = "https://docs.rs/fluence/marine-test-macro-impl"
repository = "https://github.com/fluencelabs/rust-sdk/tree/master/crates/marine-test-macro-impl"
authors = ["Fluence Labs"]
keywords = ["fluence", "sdk", "webassembly", "procedural_macros"]
categories = ["api-bindings", "wasm"]
categories = ["api-bindings", "wasm", "development-tools::testing"]
license = "Apache-2.0"
[package.metadata.docs.rs]

View File

@ -1,12 +1,13 @@
[package]
name = "marine-test-macro"
version = "0.1.6" # remember to update html_root_url
version = "0.1.8" # remember to update html_root_url
edition = "2018"
description = "Definition of the `#[marine_test]` macro"
repository = "https://github.com/fluencelabs/rust-sdk/crates/macro-test"
documentation = "https://docs.rs/fluence/marine-test-macro"
repository = "https://github.com/fluencelabs/rust-sdk/tree/master/crates/marine-test-macro"
authors = ["Fluence Labs"]
keywords = ["fluence", "sdk", "webassembly", "procedural_macros"]
categories = ["api-bindings", "wasm"]
categories = ["api-bindings", "wasm", "development-tools::testing"]
license = "Apache-2.0"
[package.metadata.docs.rs]
@ -17,7 +18,7 @@ proc-macro = true
doctest = false
[dependencies]
marine-test-macro-impl = { path = "../marine-test-macro-impl", version = "0.1.5" }
marine-test-macro-impl = { path = "../marine-test-macro-impl", version = "0.1.8" }
quote = "1.0.9"
proc-macro2 = "1.0.24"

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
#![doc(html_root_url = "https://docs.rs/fluence-test-macro/0.1.4")]
#![doc(html_root_url = "https://docs.rs/fluence-test-macro/0.1.8")]
#![deny(
dead_code,
nonstandard_style,

View File

@ -1,9 +1,10 @@
[package]
name = "marine-timestamp-macro"
version = "0.6.2" # remember to update html_root_url
version = "0.6.8" # remember to update html_root_url
edition = "2018"
description = "Definition of the `#[build_timestamp]` macro"
repository = "https://github.com/fluencelabs/rust-sdk/crates/timestamp-macro"
documentation = "https://docs.rs/fluence/marine-timestamp-macro"
repository = "https://github.com/fluencelabs/rust-sdk/tree/master/crates/marine-timestamp-macro"
authors = ["Fluence Labs"]
keywords = ["fluence", "sdk", "webassembly", "procedural_macros"]
categories = ["api-bindings", "wasm"]

View File

@ -1,13 +1,12 @@
[package]
name = "fluence-test"
version = "0.1.7" # remember to update html_root_url
version = "0.1.8" # remember to update html_root_url
description = "Fluence backend SDK for testing"
documentation = "https://docs.rs/fluence/"
repository = "https://github.com/fluencelabs/rust-sdk"
documentation = "https://docs.rs/fluence-test"
repository = "https://github.com/fluencelabs/rust-sdk/tree/master/fluence-test"
authors = ["Fluence Labs"]
#readme = "README.md"
keywords = ["fluence", "sdk", "webassembly"]
categories = ["api-bindings", "wasm"]
keywords = ["fluence", "sdk", "webassembly", "test"]
categories = ["api-bindings", "wasm", "development-tools::testing"]
license = "Apache-2.0"
edition = "2018"
@ -19,7 +18,7 @@ path = "src/lib.rs"
doctest = false
[dependencies]
marine-test-macro = { path = "../crates/marine-test-macro", version = "0.1.6" }
marine-test-macro = { path = "../crates/marine-test-macro", version = "0.1.8" }
fluence-app-service = { version = "0.7.0", features = ["raw-module-api"] }
serde = { version = "1.0.118", features = ["derive"] }

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
#![doc(html_root_url = "https://docs.rs/fluence-test/0.1.5")]
#![doc(html_root_url = "https://docs.rs/fluence-test/0.1.8")]
#![deny(
dead_code,
nonstandard_style,

View File

@ -1,11 +1,10 @@
[package]
name = "fluence"
version = "0.6.5" # remember to update html_root_url
version = "0.6.8" # remember to update html_root_url
description = "Fluence backend SDK for developing backend applications for the Fluence network"
documentation = "https://docs.rs/fluence/"
documentation = "https://docs.rs/fluence"
repository = "https://github.com/fluencelabs/rust-sdk"
authors = ["Fluence Labs"]
#readme = "README.md"
keywords = ["fluence", "sdk", "webassembly"]
categories = ["api-bindings", "wasm"]
license = "Apache-2.0"
@ -19,9 +18,9 @@ path = "src/lib.rs"
doctest = false
[dependencies]
marine-macro = { path = "../crates/marine-macro", version = "=0.6.4" }
fluence-sdk-main = { path = "../crates/main", version = "=0.6.4" }
marine-timestamp-macro = { path = "../crates/timestamp-macro", version = "=0.6.2" }
marine-macro = { path = "../crates/marine-macro", version = "=0.6.8" }
fluence-sdk-main = { path = "../crates/main", version = "=0.6.8" }
marine-timestamp-macro = { path = "../crates/timestamp-macro", version = "=0.6.8" }
serde = { version = "1.0.118", features = ["derive"]}

View File

@ -55,7 +55,7 @@
//! pub fn curl_get(url: String) -> String;
//! }
//! ```
#![doc(html_root_url = "https://docs.rs/fluence/0.5.0")]
#![doc(html_root_url = "https://docs.rs/fluence/0.6.8")]
#![deny(
dead_code,
nonstandard_style,