diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index e2f15352..69194f50 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -16,9 +16,6 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - with: - submodules: true - token: ${{ secrets.PRIVATE_REPO_RELEASE_ACCESS }} - name: rustfmt run: cargo fmt -- --check @@ -28,9 +25,6 @@ jobs: version: ${{ steps.release.outputs.release }} steps: - uses: actions/checkout@v2 - with: - submodules: true - token: ${{ secrets.PRIVATE_REPO_RELEASE_ACCESS }} - uses: actions-rs/toolchain@v1 with: toolchain: stable @@ -49,7 +43,7 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} allow-initial-development-versions: true force-bump-patch-version: true - + - name: Update Cargo Version run: | chmod +x set_cargo_version.sh @@ -66,7 +60,7 @@ jobs: ARCHIVE_FILE=archive-$VERSION.tar.gz echo "ARCHIVE_FILE="$ARCHIVE_FILE >> $GITHUB_ENV pip install git-archive-all - git-archive-all --force-submodules $ARCHIVE_FILE + git-archive-all $ARCHIVE_FILE SHA=$(openssl sha256 < ${ARCHIVE_FILE} | sed 's/.* //') echo "SHA="$SHA >> $GITHUB_ENV echo "sha is: ${SHA}" @@ -98,20 +92,17 @@ jobs: git add . git commit -m "momento-cli ${{ steps.semrel.outputs.version }}" git push origin formula/momento-cli/v${{ steps.semrel.outputs.version }} - + - name: Output release id: release run: echo "::set-output name=release::${{ steps.semrel.outputs.version }}" - + update-cargo: runs-on: ubuntu-latest needs: release steps: - uses: actions/checkout@v2 - with: - submodules: true - token: ${{ secrets.PRIVATE_REPO_RELEASE_ACCESS }} - + - name: Update Cargo Version run: | chmod +x set_cargo_version.sh @@ -136,4 +127,3 @@ jobs: fi echo ${PR_URL} shell: bash - diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 97d28def..9bf40dc0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,10 +18,6 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - with: - # this is temporary until we publish the rust sdk - submodules: true - token: ${{ secrets.PRIVATE_REPO_RELEASE_ACCESS }} - name: rustfmt run: cargo fmt -- --check - name: Rigorous lint via Clippy @@ -32,10 +28,6 @@ jobs: steps: - uses: actions/checkout@v2 - with: - # 🤮 - submodules: true - token: ${{ secrets.PRIVATE_REPO_RELEASE_ACCESS }} - uses: actions-rs/toolchain@v1 with: toolchain: stable diff --git a/CONTRIBUTING.ja.md b/CONTRIBUTING.ja.md index d3abf276..374b170f 100644 --- a/CONTRIBUTING.ja.md +++ b/CONTRIBUTING.ja.md @@ -1,11 +1,3 @@ -### 開始方法 - -``` -git submodule init -git submodule sync -git submodule update --recursive --remote -``` - ## ビルド ``` diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index abbfbb50..7072a20c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,11 +1,3 @@ -### Starting Off - -``` -git submodule init -git submodule sync -git submodule update --recursive --remote -``` - ### Building ``` diff --git a/Cargo.lock b/Cargo.lock index d5cd7e4f..ebf78c8c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -662,7 +662,9 @@ dependencies = [ [[package]] name = "momento" -version = "0.1.0" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ef16a31c0c3d9f1791eb066a4a7e224b5c5dda0a30ea9bfc768c65b1c841632" dependencies = [ "base64-url", "jsonwebtoken", diff --git a/Cargo.toml b/Cargo.toml index 87c1c070..d6e011a7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,6 +14,7 @@ toml = "0.5.8" maplit = "1.0.2" configparser = "3.0.0" regex = "1" +momento = "0.1.3" [dev-dependencies] assert_cmd = "2.0.2" @@ -47,6 +48,3 @@ version = "1.0.79" version = "0.11" features = [ "json", "rustls-tls",] default-features = false - -[dependencies.momento] -path = "./client-sdk-rust" diff --git a/client-sdk-rust b/client-sdk-rust deleted file mode 160000 index 76b0a2a9..00000000 --- a/client-sdk-rust +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 76b0a2a944e8ddebcc8423e8dc9789bcf19b4ea4 diff --git a/src/commands/cache/cache_cli.rs b/src/commands/cache/cache_cli.rs index a0181b81..5d293779 100644 --- a/src/commands/cache/cache_cli.rs +++ b/src/commands/cache/cache_cli.rs @@ -1,10 +1,11 @@ use log::{debug, info}; use momento::simple_cache_client::SimpleCacheClient; +use std::num::NonZeroU64; use crate::error::CliError; async fn get_momento_instance(auth_token: String) -> Result { - match SimpleCacheClient::new(auth_token, 100).await { + match SimpleCacheClient::new(auth_token, NonZeroU64::new(100).unwrap()).await { Ok(m) => Ok(m), Err(e) => Err(CliError { msg: e.to_string() }), } @@ -54,7 +55,12 @@ pub async fn set( debug!("setting key: {} into cache: {}", key, cache_name); let mut momento = get_momento_instance(auth_token).await?; match momento - .set(&cache_name, key, value, Some(ttl_seconds)) + .set( + &cache_name, + key, + value, + Some(NonZeroU64::new(ttl_seconds).unwrap()), + ) .await { Ok(_) => debug!("set success"), diff --git a/src/commands/signingkey/signingkey_cli.rs b/src/commands/signingkey/signingkey_cli.rs index 526f5434..5fdeee45 100644 --- a/src/commands/signingkey/signingkey_cli.rs +++ b/src/commands/signingkey/signingkey_cli.rs @@ -1,10 +1,11 @@ use log::debug; use momento::simple_cache_client::SimpleCacheClient; +use std::num::NonZeroU64; use crate::error::CliError; async fn get_momento_instance(auth_token: String) -> Result { - match SimpleCacheClient::new(auth_token, 100).await { + match SimpleCacheClient::new(auth_token, NonZeroU64::new(100).unwrap()).await { Ok(m) => Ok(m), Err(e) => Err(CliError { msg: e.to_string() }), }