-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into feature/docs/crate-level-lib
- Loading branch information
Showing
44 changed files
with
2,007 additions
and
363 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,5 +1,9 @@ | ||
name: CI | ||
|
||
permissions: | ||
pull-requests: write | ||
contents: write | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
|
@@ -47,74 +51,21 @@ jobs: | |
- name: Run cargo fmt | ||
run: cargo fmt --all -- --check | ||
|
||
publish: | ||
runs-on: ubuntu-20.04 | ||
release-plz: | ||
runs-on: ubuntu-latest | ||
needs: [test, clippy, cargo-fmt] | ||
if: github.ref == 'refs/heads/master' | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v2 | ||
with: | ||
# fetch tags for cargo ws publish | ||
# might be a simple `fetch-tags: true` option soon, see https://github.com/actions/checkout/pull/579 | ||
fetch-depth: 0 | ||
|
||
- name: Setup | ||
run: | | ||
git config user.name github-actions | ||
git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||
cargo install --git https://github.com/miraclx/cargo-workspaces --rev b2d49b9e575e29fd2395352e4d0df47def025039 cargo-workspaces | ||
export GIT_PREVIOUS_TAG=$(git describe --tags --abbrev=0) | ||
echo "GIT_PREVIOUS_TAG=${GIT_PREVIOUS_TAG}" >> $GITHUB_ENV | ||
echo "[ pre run] current latest git tag is \"${GIT_PREVIOUS_TAG}\"" | ||
- name: Publish to crates.io and tag the commit | ||
id: tag-and-publish | ||
env: | ||
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | ||
run: | | ||
cargo ws publish --all --yes --exact \ | ||
--skip-published --no-git-commit --allow-dirty \ | ||
--tag-existing --tag-prefix 'v' \ | ||
--tag-msg 'crates.io snapshot' --tag-msg '%{https://crates.io/crates/%n/%v}' \ | ||
--no-individual-tags --no-git-push | ||
export GIT_LATEST_TAG=$(git describe --tags --abbrev=0) | ||
echo "GIT_LATEST_TAG=${GIT_LATEST_TAG}" >> $GITHUB_ENV | ||
echo "[post run] current latest git tag is \"${GIT_LATEST_TAG}\"" | ||
echo "::set-output name=tagged::$( [[ "$GIT_LATEST_TAG" == "$GIT_PREVIOUS_TAG" ]] && echo 0 || echo 1 )" | ||
# returning multi-line outputs gets truncated to include only the first line | ||
# we have to escape the newline chars, runner auto unescapes them later | ||
# https://github.community/t/set-output-truncates-multiline-strings/16852/3 | ||
GIT_TAG_MESSAGE="$(git tag -l --format='%(body)' ${GIT_LATEST_TAG})" | ||
GIT_TAG_MESSAGE="${GIT_TAG_MESSAGE//'%'/'%25'}" | ||
GIT_TAG_MESSAGE="${GIT_TAG_MESSAGE//$'\n'/'%0A'}" | ||
GIT_TAG_MESSAGE="${GIT_TAG_MESSAGE//$'\r'/'%0D'}" | ||
echo "::set-output name=git_tag_message::${GIT_TAG_MESSAGE}" | ||
- name: Push tags to GitHub (if any) | ||
if: steps.tag-and-publish.outputs.tagged == 1 | ||
run: git push --tags | ||
|
||
- name: Extract release notes | ||
if: steps.tag-and-publish.outputs.tagged == 1 | ||
id: extract-release-notes | ||
uses: ffurrer2/extract-release-notes@c24866884b7a0d2fd2095be2e406b6f260479da8 | ||
|
||
- name: Create release | ||
if: steps.tag-and-publish.outputs.tagged == 1 | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ env.GIT_LATEST_TAG }} | ||
release_name: ${{ env.GIT_LATEST_TAG }} | ||
body: | | ||
## What's changed? | ||
${{ steps.extract-release-notes.outputs.release_notes }} | ||
**Crate Link**: ${{ steps.tag-and-publish.outputs.git_tag_message }} | ||
**Full Changelog**: https://github.com/${{ github.repository }}/compare/${{ env.GIT_PREVIOUS_TAG }}...${{ env.GIT_LATEST_TAG }} | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
token: ${{ secrets.CUSTOM_GITHUB_TOKEN }} | ||
- name: Install Rust toolchain | ||
uses: dtolnay/rust-toolchain@stable | ||
- name: Run release-plz | ||
uses: MarcoIeni/[email protected] | ||
env: | ||
# https://marcoieni.github.io/release-plz/github-action.html#triggering-further-workflow-runs | ||
GITHUB_TOKEN: ${{ secrets.CUSTOM_GITHUB_TOKEN }} | ||
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} |
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 |
---|---|---|
@@ -1,2 +1,10 @@ | ||
# Rust artifacts | ||
/target | ||
Cargo.lock | ||
|
||
# IDEs | ||
.idea | ||
.vscode | ||
|
||
# macOS | ||
.DS_Store |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,43 @@ | ||
[package] | ||
name = "near-jsonrpc-client" | ||
version = "0.0.0" # managed by cargo-workspaces, see below | ||
version = "0.6.0" | ||
authors = ["Near Inc <[email protected]>"] | ||
edition = "2021" | ||
license = "MIT OR Apache-2.0" | ||
repository = "https://github.com/near/near-jsonrpc-client-rs" | ||
description = "Lower-level API for interfacing with the NEAR Protocol via JSONRPC" | ||
categories = ["asynchronous", "api-bindings", "network-programming"] | ||
keywords = ["near", "api", "jsonrpc", "rpc", "async"] | ||
rust-version = "1.56.0" | ||
|
||
# cargo-workspaces | ||
[workspace.metadata.workspaces] | ||
version = "0.3.0" | ||
rust-version = "1.67.1" | ||
|
||
[dependencies] | ||
uuid = { version = "0.8", features = ["v4"], optional = true } | ||
borsh = "0.9" | ||
serde = "1.0.127" | ||
reqwest = { version = "0.11.4", features = ["json"] } | ||
thiserror = "1.0.28" | ||
serde_json = "1.0.66" | ||
log = "0.4.17" | ||
borsh = "1.3.0" | ||
serde = "1.0.145" | ||
reqwest = { version = "0.11.12", features = ["json"], default-features = false } | ||
thiserror = "1.0.37" | ||
serde_json = "1.0.85" | ||
lazy_static = "1.4.0" | ||
|
||
near-crypto = "0.12.0" | ||
near-primitives = "0.12.0" | ||
near-chain-configs = "0.12.0" | ||
near-jsonrpc-primitives = "0.12.0" | ||
near-crypto = "0.19.0" | ||
near-primitives = "0.19.0" | ||
near-chain-configs = "0.19.0" | ||
near-jsonrpc-primitives = "0.19.0" | ||
|
||
[dev-dependencies] | ||
tokio = { version = "1.1", features = ["rt", "macros"] } | ||
tokio = { version = "1.0", features = ["macros", "rt-multi-thread"] } | ||
env_logger = "0.10.0" | ||
|
||
[features] | ||
default = ["auth"] | ||
default = ["native-tls"] | ||
any = [] | ||
auth = ["uuid"] | ||
sandbox = [] | ||
adversarial = [] | ||
native-tls = ["reqwest/native-tls"] | ||
rustls-tls = ["reqwest/rustls-tls"] | ||
|
||
[[example]] | ||
name = "auth" | ||
required-features = ["auth"] | ||
|
||
[package.metadata.docs.rs] | ||
features = ["any", "auth", "sandbox"] | ||
features = ["any", "sandbox"] |
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
Oops, something went wrong.