From 6d6be4886ce80253aecc1caf343c14650a2acc0c Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Fri, 28 Oct 2022 23:57:06 -0700 Subject: [PATCH 01/39] Run CLI builds and tests on all platforms --- .github/workflows/publish.yml | 15 +++++++++------ .github/workflows/rust.yml | 34 +++++++++++++++++++++++++++++++--- 2 files changed, 40 insertions(+), 9 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 042cd26f1..75c5d1f9f 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -24,23 +24,26 @@ jobs: target: x86_64-apple-darwin - os: macos-latest target: aarch64-apple-darwin - # TODO: Re-enable when this job is updated to support Windows. - # - os: windows-latest - # target: x86_64-pc-windows-msvc - # ext: .exe + - os: windows-latest + target: x86_64-pc-windows-msvc + ext: .exe runs-on: ${{ matrix.os }} env: VERSION: '${{ github.event.release.release.name }}' NAME: 'soroban-cli-${{ github.event.release.release.name }}-${{ matrix.target }}' steps: - uses: actions/checkout@v3 - - run: rustup update - - run: rustup target add ${{ matrix.target }} + - shell: bash + run: rustup update + - shell: bash + run: rustup target add ${{ matrix.target }} - if: matrix.apt-install run: sudo apt-get -y install ${{ matrix.apt-install }} - name: Package + shell: bash run: cargo package --no-verify - name: Build + shell: bash run: | cd target/package tar xvfz soroban-cli-$VERSION.crate diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 132abab57..c7cd7fe0f 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -38,8 +38,21 @@ jobs: strategy: matrix: include: - - os: ubuntu-latest - target: x86_64-unknown-linux-gnu + - os: ubuntu-latest + target: x86_64-unknown-linux-gnu + test: true + - os: ubuntu-latest + target: aarch64-unknown-linux-gnu + test: false + - os: macos-latest + target: x86_64-apple-darwin + test: true + - os: macos-latest + target: aarch64-apple-darwin + test: false + - os: windows-latest + target: x86_64-pc-windows-msvc + test: true runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 @@ -48,7 +61,8 @@ jobs: - run: rustup target add ${{ matrix.target }} - run: cargo clippy --all-targets --target ${{ matrix.target }} - run: make build-test-wasms - - run: cargo test --workspace --target ${{ matrix.target }} + - if: matrix.test + run: cargo test --workspace --target ${{ matrix.target }} e2e-test: strategy: @@ -77,6 +91,20 @@ jobs: include: - os: ubuntu-latest target: x86_64-unknown-linux-gnu + test: true + - os: ubuntu-latest + target: aarch64-unknown-linux-gnu + test: false + - os: macos-latest + target: x86_64-apple-darwin + test: true + - os: macos-latest + target: aarch64-apple-darwin + test: false + - os: windows-latest + target: x86_64-pc-windows-msvc + test: true + # TODO: Pass through whether tests should be run or not. uses: stellar/actions/.github/workflows/rust-publish-dry-run.yml@main with: runs-on: ${{ matrix.os }} From daf3698ed51f6f8f6f036181a4e469c8ea633b91 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Sat, 29 Oct 2022 00:05:01 -0700 Subject: [PATCH 02/39] use bash --- .github/workflows/rust.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index c7cd7fe0f..29bc9fb7c 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -57,11 +57,16 @@ jobs: steps: - uses: actions/checkout@v3 - uses: stellar/actions/rust-cache@main - - run: rustup update - - run: rustup target add ${{ matrix.target }} - - run: cargo clippy --all-targets --target ${{ matrix.target }} - - run: make build-test-wasms + - shell: bash + run: rustup update + - shell: bash + run: rustup target add ${{ matrix.target }} + - shell: bash + run: cargo clippy --all-targets --target ${{ matrix.target }} + - shell: bash + run: make build-test-wasms - if: matrix.test + shell: bash run: cargo test --workspace --target ${{ matrix.target }} e2e-test: From f3c25ef57a3108fdb42ddde194d2e7a799b0dad5 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Sat, 29 Oct 2022 00:10:07 -0700 Subject: [PATCH 03/39] fix --- .github/workflows/rust.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 29bc9fb7c..d0a8b02a2 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -43,6 +43,7 @@ jobs: test: true - os: ubuntu-latest target: aarch64-unknown-linux-gnu + apt-install: gcc-aarch64-linux-gnu test: false - os: macos-latest target: x86_64-apple-darwin @@ -61,6 +62,8 @@ jobs: run: rustup update - shell: bash run: rustup target add ${{ matrix.target }} + - if: matrix.apt-install + run: sudo apt-get -y install ${{ matrix.apt-install }} - shell: bash run: cargo clippy --all-targets --target ${{ matrix.target }} - shell: bash From 2085416accc31f48fb66c6eb7208eb161f5ca7f0 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Mon, 31 Oct 2022 12:23:45 -0700 Subject: [PATCH 04/39] use defaults --- .github/workflows/publish.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 75c5d1f9f..4e03e416c 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -28,22 +28,21 @@ jobs: target: x86_64-pc-windows-msvc ext: .exe runs-on: ${{ matrix.os }} + defaults: + run: + shell: bash env: VERSION: '${{ github.event.release.release.name }}' NAME: 'soroban-cli-${{ github.event.release.release.name }}-${{ matrix.target }}' steps: - uses: actions/checkout@v3 - - shell: bash - run: rustup update - - shell: bash - run: rustup target add ${{ matrix.target }} + - run: rustup update + - run: rustup target add ${{ matrix.target }} - if: matrix.apt-install run: sudo apt-get -y install ${{ matrix.apt-install }} - name: Package - shell: bash run: cargo package --no-verify - name: Build - shell: bash run: | cd target/package tar xvfz soroban-cli-$VERSION.crate From 759d76921d2c558df30a92b2913cb2dc26276896 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Mon, 31 Oct 2022 12:26:26 -0700 Subject: [PATCH 05/39] workflow --- .github/workflows/publish.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 4e03e416c..5949941ae 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -4,6 +4,10 @@ on: release: types: [published] +defaults: + run: + shell: bash + jobs: publish: @@ -28,9 +32,6 @@ jobs: target: x86_64-pc-windows-msvc ext: .exe runs-on: ${{ matrix.os }} - defaults: - run: - shell: bash env: VERSION: '${{ github.event.release.release.name }}' NAME: 'soroban-cli-${{ github.event.release.release.name }}-${{ matrix.target }}' From 5c66e445c4c8a837b020ddeebda35482d12d775d Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Mon, 31 Oct 2022 15:35:30 -0700 Subject: [PATCH 06/39] fix --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 5949941ae..b59d0ac3f 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -23,7 +23,7 @@ jobs: target: x86_64-unknown-linux-gnu - os: ubuntu-latest target: aarch64-unknown-linux-gnu - apt-install: gcc-aarch64-linux-gnu + apt-install: gcc-aarch64-linux-gnu aarch64-linux-gnu-g++ - os: macos-latest target: x86_64-apple-darwin - os: macos-latest From 8c26c3c3da893a69b5120a61dbf4416830e42248 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Mon, 31 Oct 2022 15:47:17 -0700 Subject: [PATCH 07/39] fix --- .github/workflows/rust.yml | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index d0a8b02a2..25b580a16 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -8,6 +8,10 @@ on: env: RUSTFLAGS: -Dwarnings -Dclippy::all -Dclippy::pedantic +defaults: + run: + shell: bash + jobs: complete: @@ -43,7 +47,7 @@ jobs: test: true - os: ubuntu-latest target: aarch64-unknown-linux-gnu - apt-install: gcc-aarch64-linux-gnu + apt-install: gcc-aarch64-linux-gnu aarch64-linux-gnu-g++ test: false - os: macos-latest target: x86_64-apple-darwin @@ -58,18 +62,13 @@ jobs: steps: - uses: actions/checkout@v3 - uses: stellar/actions/rust-cache@main - - shell: bash - run: rustup update - - shell: bash - run: rustup target add ${{ matrix.target }} + - run: rustup update + - run: rustup target add ${{ matrix.target }} - if: matrix.apt-install run: sudo apt-get -y install ${{ matrix.apt-install }} - - shell: bash - run: cargo clippy --all-targets --target ${{ matrix.target }} - - shell: bash - run: make build-test-wasms + - run: cargo clippy --all-targets --target ${{ matrix.target }} + - run: make build-test-wasms - if: matrix.test - shell: bash run: cargo test --workspace --target ${{ matrix.target }} e2e-test: From d85ba48617712df307645e9a5c0789e2b0323383 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Mon, 31 Oct 2022 16:20:55 -0700 Subject: [PATCH 08/39] fix --- .github/workflows/rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 25b580a16..703093e62 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -47,7 +47,7 @@ jobs: test: true - os: ubuntu-latest target: aarch64-unknown-linux-gnu - apt-install: gcc-aarch64-linux-gnu aarch64-linux-gnu-g++ + apt-install: 'gcc-aarch64-linux-gnu aarch64-linux-gnu-g++' test: false - os: macos-latest target: x86_64-apple-darwin From 12e926f7c082cf726e7ed1e1fd50094a1c84e8a5 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Mon, 31 Oct 2022 16:22:52 -0700 Subject: [PATCH 09/39] fix --- .github/workflows/rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 703093e62..64253ac82 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -47,7 +47,7 @@ jobs: test: true - os: ubuntu-latest target: aarch64-unknown-linux-gnu - apt-install: 'gcc-aarch64-linux-gnu aarch64-linux-gnu-g++' + apt-install: gcc-aarch64-linux-gnu g++-aarch64-linux-gnu test: false - os: macos-latest target: x86_64-apple-darwin From 3b923f316cec7ed1db048ea60a3368f7717f569c Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Tue, 1 Nov 2022 08:30:21 -0700 Subject: [PATCH 10/39] empty commit From 53934bc4c7149b52d3b7111586e4194c3c96732c Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Wed, 2 Nov 2022 23:12:27 -0700 Subject: [PATCH 11/39] try publish dry run and publish --- .github/workflows/publish.yml | 35 ++++++++++++++++++++--------------- .github/workflows/rust.yml | 2 +- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index b59d0ac3f..088082fba 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -3,6 +3,7 @@ name: Publish on: release: types: [published] + pull_request: defaults: run: @@ -10,10 +11,10 @@ defaults: jobs: - publish: - uses: stellar/actions/.github/workflows/rust-publish.yml@main - secrets: - CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} + # publish: + # uses: stellar/actions/.github/workflows/rust-publish.yml@main + # secrets: + # CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} upload: strategy: @@ -49,15 +50,19 @@ jobs: tar xvfz soroban-cli-$VERSION.crate cd soroban-cli-$VERSION cargo build --target-dir=../.. --release --target ${{ matrix.target }} - - name: Upload - uses: actions/github-script@v6 + - uses: actions/upload-artifact@v3 with: - script: | - const fs = require('fs'); - await github.rest.repos.uploadReleaseAsset({ - owner: context.repo.owner, - repo: context.repo.repo, - release_id: ${{ github.event.release.release.id }}, - name: '${{ env.NAME }}${{ matrix.ext }}', - data: fs.readFileSync('target/${{ matrix.target }}/release/soroban${{ matrix.ext }}'), - }); + name: soroban-${{ matrix.os }}-${{ matrix.target }}-${{ matrix.runs-on }} + path: 'target/${{ matrix.target }}/release/soroban${{ matrix.ext }}' + # - name: Upload + # uses: actions/github-script@v6 + # with: + # script: | + # const fs = require('fs'); + # await github.rest.repos.uploadReleaseAsset({ + # owner: context.repo.owner, + # repo: context.repo.repo, + # release_id: ${{ github.event.release.release.id }}, + # name: '${{ env.NAME }}${{ matrix.ext }}', + # data: fs.readFileSync('target/${{ matrix.target }}/release/soroban${{ matrix.ext }}'), + # }); diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 64253ac82..4025119af 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -92,7 +92,7 @@ jobs: - run: cargo test --test 'e2e*' --target ${{ matrix.target }} -- --ignored --test-threads 1 publish-dry-run: - if: startsWith(github.head_ref, 'release/') + # if: startsWith(github.head_ref, 'release/') strategy: matrix: include: From f7a475b8309914b2cad04ad010ba26db351d0c71 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Wed, 2 Nov 2022 23:19:34 -0700 Subject: [PATCH 12/39] fix --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 088082fba..938c5d9c7 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -24,7 +24,7 @@ jobs: target: x86_64-unknown-linux-gnu - os: ubuntu-latest target: aarch64-unknown-linux-gnu - apt-install: gcc-aarch64-linux-gnu aarch64-linux-gnu-g++ + apt-install: gcc-aarch64-linux-gnu g++aarch64-linux-gnu - os: macos-latest target: x86_64-apple-darwin - os: macos-latest From 63aba84029dca0a016ddc67a1e8ecabbd4ccd82f Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Thu, 3 Nov 2022 00:06:23 -0700 Subject: [PATCH 13/39] update deps --- Cargo.lock | 76 +++++++++---------- Cargo.toml | 32 ++++---- src/invoke.rs | 14 ++-- src/snapshot.rs | 4 +- src/token/create.rs | 14 ++-- src/token/wrap.rs | 14 ++-- src/utils.rs | 2 +- .../invoker_account_exists/src/lib.rs | 4 +- 8 files changed, 84 insertions(+), 76 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 09ce96d60..d08f0500f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1135,6 +1135,17 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-derive" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "num-integer" version = "0.1.45" @@ -1218,12 +1229,6 @@ version = "6.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ff7415e9ae3fff1225851df9e0d9e4e5479f947619774677a63572e55e80eff" -[[package]] -name = "parity-wasm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be5e13c266502aadf83426d87d81a0f5d1ef45b8027f5a471c360abfe4bfae92" - [[package]] name = "parking_lot" version = "0.12.1" @@ -1823,8 +1828,8 @@ dependencies = [ [[package]] name = "soroban-auth" -version = "0.1.0" -source = "git+https://github.com/stellar/rs-soroban-sdk?rev=b66355c4#b66355c40288a245b91901c1bfa366793b656672" +version = "0.2.0" +source = "git+https://github.com/stellar/rs-soroban-sdk?rev=3ec51a3d#3ec51a3d48a3ffc33e75064c3cfb66a1f704a953" dependencies = [ "soroban-sdk", ] @@ -1855,7 +1860,7 @@ dependencies = [ "soroban-env-host", "soroban-spec", "soroban-token-spec", - "stellar-strkey 0.0.6", + "stellar-strkey", "thiserror", "tokio", "warp", @@ -1865,8 +1870,8 @@ dependencies = [ [[package]] name = "soroban-env-common" -version = "0.0.6" -source = "git+https://github.com/stellar/rs-soroban-env?rev=4f2f3a2d#4f2f3a2da58dd869b559f41311815b20d1552ce5" +version = "0.0.9" +source = "git+https://github.com/stellar/rs-soroban-env?rev=c04c2332#c04c2332fd3ed3ee0e4b72c68c618c7f45f44ba1" dependencies = [ "soroban-env-macros", "soroban-wasmi", @@ -1876,8 +1881,8 @@ dependencies = [ [[package]] name = "soroban-env-guest" -version = "0.0.6" -source = "git+https://github.com/stellar/rs-soroban-env?rev=4f2f3a2d#4f2f3a2da58dd869b559f41311815b20d1552ce5" +version = "0.0.9" +source = "git+https://github.com/stellar/rs-soroban-env?rev=c04c2332#c04c2332fd3ed3ee0e4b72c68c618c7f45f44ba1" dependencies = [ "soroban-env-common", "static_assertions", @@ -1885,8 +1890,8 @@ dependencies = [ [[package]] name = "soroban-env-host" -version = "0.0.6" -source = "git+https://github.com/stellar/rs-soroban-env?rev=4f2f3a2d#4f2f3a2da58dd869b559f41311815b20d1552ce5" +version = "0.0.9" +source = "git+https://github.com/stellar/rs-soroban-env?rev=c04c2332#c04c2332fd3ed3ee0e4b72c68c618c7f45f44ba1" dependencies = [ "backtrace", "dyn-fmt", @@ -1895,9 +1900,9 @@ dependencies = [ "im-rc", "log", "num-bigint", + "num-derive", "num-integer", "num-traits", - "parity-wasm", "sha2 0.10.6", "soroban-env-common", "soroban-native-sdk-macros", @@ -1908,8 +1913,8 @@ dependencies = [ [[package]] name = "soroban-env-macros" -version = "0.0.6" -source = "git+https://github.com/stellar/rs-soroban-env?rev=4f2f3a2d#4f2f3a2da58dd869b559f41311815b20d1552ce5" +version = "0.0.9" +source = "git+https://github.com/stellar/rs-soroban-env?rev=c04c2332#c04c2332fd3ed3ee0e4b72c68c618c7f45f44ba1" dependencies = [ "itertools", "proc-macro2", @@ -1920,8 +1925,8 @@ dependencies = [ [[package]] name = "soroban-native-sdk-macros" -version = "0.0.6" -source = "git+https://github.com/stellar/rs-soroban-env?rev=4f2f3a2d#4f2f3a2da58dd869b559f41311815b20d1552ce5" +version = "0.0.9" +source = "git+https://github.com/stellar/rs-soroban-env?rev=c04c2332#c04c2332fd3ed3ee0e4b72c68c618c7f45f44ba1" dependencies = [ "itertools", "proc-macro2", @@ -1931,8 +1936,8 @@ dependencies = [ [[package]] name = "soroban-sdk" -version = "0.1.0" -source = "git+https://github.com/stellar/rs-soroban-sdk?rev=b66355c4#b66355c40288a245b91901c1bfa366793b656672" +version = "0.2.0" +source = "git+https://github.com/stellar/rs-soroban-sdk?rev=3ec51a3d#3ec51a3d48a3ffc33e75064c3cfb66a1f704a953" dependencies = [ "bytes-lit", "ed25519-dalek", @@ -1940,13 +1945,13 @@ dependencies = [ "soroban-env-guest", "soroban-env-host", "soroban-sdk-macros", - "stellar-strkey 0.0.2", + "stellar-strkey", ] [[package]] name = "soroban-sdk-macros" -version = "0.1.0" -source = "git+https://github.com/stellar/rs-soroban-sdk?rev=b66355c4#b66355c40288a245b91901c1bfa366793b656672" +version = "0.2.0" +source = "git+https://github.com/stellar/rs-soroban-sdk?rev=3ec51a3d#3ec51a3d48a3ffc33e75064c3cfb66a1f704a953" dependencies = [ "darling", "itertools", @@ -1961,8 +1966,8 @@ dependencies = [ [[package]] name = "soroban-spec" -version = "0.1.0" -source = "git+https://github.com/stellar/rs-soroban-sdk?rev=b66355c4#b66355c40288a245b91901c1bfa366793b656672" +version = "0.2.0" +source = "git+https://github.com/stellar/rs-soroban-sdk?rev=3ec51a3d#3ec51a3d48a3ffc33e75064c3cfb66a1f704a953" dependencies = [ "base64", "darling", @@ -1983,8 +1988,8 @@ dependencies = [ [[package]] name = "soroban-token-spec" -version = "0.1.0" -source = "git+https://github.com/stellar/rs-soroban-sdk?rev=b66355c4#b66355c40288a245b91901c1bfa366793b656672" +version = "0.2.0" +source = "git+https://github.com/stellar/rs-soroban-sdk?rev=3ec51a3d#3ec51a3d48a3ffc33e75064c3cfb66a1f704a953" dependencies = [ "soroban-auth", "soroban-sdk", @@ -2030,15 +2035,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" -[[package]] -name = "stellar-strkey" -version = "0.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "350ec80765002d972f7fa9bc2bd9e550fc3bf9fbe3f1c0e55b30755fccc2fd34" -dependencies = [ - "base32", -] - [[package]] name = "stellar-strkey" version = "0.0.6" @@ -2050,8 +2046,8 @@ dependencies = [ [[package]] name = "stellar-xdr" -version = "0.0.6" -source = "git+https://github.com/stellar/rs-stellar-xdr?rev=3ba13687#3ba1368786bc222735b09b3f99c0c8e6a71c18ce" +version = "0.0.7" +source = "git+https://github.com/stellar/rs-stellar-xdr?rev=e88f9fa7#e88f9fa7ab3d0f54efb5cee8499ef9080f4d41f4" dependencies = [ "base64", "hex", diff --git a/Cargo.toml b/Cargo.toml index 4b18808c4..5cf029f33 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -59,26 +59,26 @@ members = [ default-members = ["."] [workspace.dependencies] -soroban-env-host = "0.0.6" -soroban-spec = "0.1.0" -soroban-token-spec = "0.1.0" -soroban-auth = "0.1.0" +soroban-env-host = "0.0.9" +soroban-spec = "0.2.0" +soroban-token-spec = "0.2.0" +soroban-auth = "0.2.0" stellar-strkey = "0.0.6" -soroban-sdk = "0.1.0" +soroban-sdk = "0.2.0" [patch.crates-io] -soroban-spec = { git = "https://github.com/stellar/rs-soroban-sdk", rev = "b66355c4" } -soroban-token-spec = { git = "https://github.com/stellar/rs-soroban-sdk", rev = "b66355c4" } -soroban-auth = { git = "https://github.com/stellar/rs-soroban-sdk", rev = "b66355c4" } -soroban-sdk = { git = "https://github.com/stellar/rs-soroban-sdk", rev = "b66355c4" } -soroban-sdk-macros = { git = "https://github.com/stellar/rs-soroban-sdk", rev = "b66355c4" } +soroban-spec = { git = "https://github.com/stellar/rs-soroban-sdk", rev = "3ec51a3d" } +soroban-token-spec = { git = "https://github.com/stellar/rs-soroban-sdk", rev = "3ec51a3d" } +soroban-auth = { git = "https://github.com/stellar/rs-soroban-sdk", rev = "3ec51a3d" } +soroban-sdk = { git = "https://github.com/stellar/rs-soroban-sdk", rev = "3ec51a3d" } +soroban-sdk-macros = { git = "https://github.com/stellar/rs-soroban-sdk", rev = "3ec51a3d" } stellar-strkey = { git = "https://github.com/stellar/rs-stellar-strkey", rev = "d1b68fd1" } -soroban-env-common = { git = "https://github.com/stellar/rs-soroban-env", rev = "4f2f3a2d" } -soroban-env-guest = { git = "https://github.com/stellar/rs-soroban-env", rev = "4f2f3a2d" } -soroban-env-host = { git = "https://github.com/stellar/rs-soroban-env", rev = "4f2f3a2d" } -soroban-env-macros = { git = "https://github.com/stellar/rs-soroban-env", rev = "4f2f3a2d" } -soroban-native-sdk-macros = { git = "https://github.com/stellar/rs-soroban-env", rev = "4f2f3a2d" } -stellar-xdr = { git = "https://github.com/stellar/rs-stellar-xdr", rev = "3ba13687" } +soroban-env-common = { git = "https://github.com/stellar/rs-soroban-env", rev = "c04c2332" } +soroban-env-guest = { git = "https://github.com/stellar/rs-soroban-env", rev = "c04c2332" } +soroban-env-host = { git = "https://github.com/stellar/rs-soroban-env", rev = "c04c2332" } +soroban-env-macros = { git = "https://github.com/stellar/rs-soroban-env", rev = "c04c2332" } +soroban-native-sdk-macros = { git = "https://github.com/stellar/rs-soroban-env", rev = "c04c2332" } +stellar-xdr = { git = "https://github.com/stellar/rs-stellar-xdr", rev = "e88f9fa7" } wasmi = { package = "soroban-wasmi", git = "https://github.com/stellar/wasmi", rev = "d1ec0036" } # soroban-env-common = { path = "../rs-soroban-env/soroban-env-common" } diff --git a/src/invoke.rs b/src/invoke.rs index daefa492b..2cdb1e292 100644 --- a/src/invoke.rs +++ b/src/invoke.rs @@ -445,11 +445,15 @@ impl Cmd { } } - snapshot::commit(state.1, ledger_info, &storage.map, &self.ledger_file).map_err(|e| { - Error::CannotCommitLedgerFile { - filepath: self.ledger_file.clone(), - error: e, - } + snapshot::commit( + state.1, + ledger_info, + &storage.map, + &self.ledger_file, + ) + .map_err(|e| Error::CannotCommitLedgerFile { + filepath: self.ledger_file.clone(), + error: e, })?; Ok(()) } diff --git a/src/snapshot.rs b/src/snapshot.rs index d5e4acf05..334b10393 100644 --- a/src/snapshot.rs +++ b/src/snapshot.rs @@ -94,7 +94,7 @@ pub fn commit<'a, I>( output_file: &std::path::PathBuf, ) -> Result<(), Error> where - I: IntoIterator)>, + I: IntoIterator, &'a Option>)>, { //Need to start off with the existing snapshot (new_state) since it's possible the storage_map did not touch every existing entry if let Some(dir) = output_file.parent() { @@ -106,7 +106,7 @@ where let file = File::create(output_file)?; for (lk, ole) in storage_map { if let Some(le) = ole { - new_state.insert(lk.clone(), le.clone()); + new_state.insert(*lk.clone(), *(*le).clone()); } else { new_state.remove(lk); } diff --git a/src/token/create.rs b/src/token/create.rs index 08dce639a..2ed5633d1 100644 --- a/src/token/create.rs +++ b/src/token/create.rs @@ -203,11 +203,15 @@ impl Cmd { )) })?; - snapshot::commit(state.1, ledger_info, &storage.map, &self.ledger_file).map_err(|e| { - Error::CannotCommitLedgerFile { - filepath: self.ledger_file.clone(), - error: e, - } + snapshot::commit( + state.1, + ledger_info, + &storage.map, + &self.ledger_file, + ) + .map_err(|e| Error::CannotCommitLedgerFile { + filepath: self.ledger_file.clone(), + error: e, })?; Ok(res_str) } diff --git a/src/token/wrap.rs b/src/token/wrap.rs index 585fcd1d6..d84ff438b 100644 --- a/src/token/wrap.rs +++ b/src/token/wrap.rs @@ -151,11 +151,15 @@ impl Cmd { )) })?; - snapshot::commit(state.1, ledger_info, &storage.map, &self.ledger_file).map_err(|e| { - Error::CannotCommitLedgerFile { - filepath: self.ledger_file.clone(), - error: e, - } + snapshot::commit( + state.1, + ledger_info, + &storage.map, + &self.ledger_file, + ) + .map_err(|e| Error::CannotCommitLedgerFile { + filepath: self.ledger_file.clone(), + error: e, })?; Ok(res_str) } diff --git a/src/utils.rs b/src/utils.rs index cb426b2f8..3afa393d3 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -157,7 +157,7 @@ pub fn create_ledger_footprint(footprint: &Footprint) -> LedgerFootprint { AccessType::ReadOnly => &mut read_only, AccessType::ReadWrite => &mut read_write, }; - dest.push(k.clone()); + dest.push(*k.clone()); } LedgerFootprint { read_only: read_only.try_into().unwrap(), diff --git a/tests/fixtures/test-wasms/invoker_account_exists/src/lib.rs b/tests/fixtures/test-wasms/invoker_account_exists/src/lib.rs index ede614519..221060570 100644 --- a/tests/fixtures/test-wasms/invoker_account_exists/src/lib.rs +++ b/tests/fixtures/test-wasms/invoker_account_exists/src/lib.rs @@ -1,5 +1,5 @@ #![no_std] -use soroban_sdk::{contracterror, contractimpl, panic_error, Address, Env}; +use soroban_sdk::{contracterror, contractimpl, panic_with_error, Address, Env}; #[contracterror] #[derive(Copy, Clone)] @@ -15,7 +15,7 @@ impl Contract { pub fn invkexists(env: Env) -> bool { match env.invoker() { Address::Account(account_id) => env.accounts().get(&account_id).is_some(), - Address::Contract(_) => panic_error!(&env, Error::InvokerIsContract), + Address::Contract(_) => panic_with_error!(&env, Error::InvokerIsContract), } } } From 13e375ec33f45e22c15c1e16c0bb1ed7693dec69 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Thu, 3 Nov 2022 00:08:11 -0700 Subject: [PATCH 14/39] fix --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 938c5d9c7..50b79bb60 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -24,7 +24,7 @@ jobs: target: x86_64-unknown-linux-gnu - os: ubuntu-latest target: aarch64-unknown-linux-gnu - apt-install: gcc-aarch64-linux-gnu g++aarch64-linux-gnu + apt-install: gcc-aarch64-linux-gnu g++-aarch64-linux-gnu - os: macos-latest target: x86_64-apple-darwin - os: macos-latest From 8b7b0b9bf53c6fe7320817d3822111eee0440d9b Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Thu, 3 Nov 2022 10:33:50 -0700 Subject: [PATCH 15/39] set version --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 50b79bb60..078ef8b3c 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -34,7 +34,7 @@ jobs: ext: .exe runs-on: ${{ matrix.os }} env: - VERSION: '${{ github.event.release.release.name }}' + VERSION: '0.1.2' # '${{ github.event.release.release.name }}' NAME: 'soroban-cli-${{ github.event.release.release.name }}-${{ matrix.target }}' steps: - uses: actions/checkout@v3 From a2d83969cb2810573f7be2fcba205983d4c6cd37 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Thu, 3 Nov 2022 11:13:21 -0700 Subject: [PATCH 16/39] disable temp --- .github/workflows/publish.yml | 2 +- .github/workflows/rust.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 078ef8b3c..836a2b113 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -3,7 +3,7 @@ name: Publish on: release: types: [published] - pull_request: + # pull_request: defaults: run: diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 4025119af..64253ac82 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -92,7 +92,7 @@ jobs: - run: cargo test --test 'e2e*' --target ${{ matrix.target }} -- --ignored --test-threads 1 publish-dry-run: - # if: startsWith(github.head_ref, 'release/') + if: startsWith(github.head_ref, 'release/') strategy: matrix: include: From a51b47279556ff7142f19c6ff7c8fb44f56ff046 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Thu, 3 Nov 2022 11:18:17 -0700 Subject: [PATCH 17/39] fmt --- src/invoke.rs | 14 +++++--------- src/token/create.rs | 14 +++++--------- src/token/wrap.rs | 14 +++++--------- 3 files changed, 15 insertions(+), 27 deletions(-) diff --git a/src/invoke.rs b/src/invoke.rs index 2cdb1e292..daefa492b 100644 --- a/src/invoke.rs +++ b/src/invoke.rs @@ -445,15 +445,11 @@ impl Cmd { } } - snapshot::commit( - state.1, - ledger_info, - &storage.map, - &self.ledger_file, - ) - .map_err(|e| Error::CannotCommitLedgerFile { - filepath: self.ledger_file.clone(), - error: e, + snapshot::commit(state.1, ledger_info, &storage.map, &self.ledger_file).map_err(|e| { + Error::CannotCommitLedgerFile { + filepath: self.ledger_file.clone(), + error: e, + } })?; Ok(()) } diff --git a/src/token/create.rs b/src/token/create.rs index 2ed5633d1..08dce639a 100644 --- a/src/token/create.rs +++ b/src/token/create.rs @@ -203,15 +203,11 @@ impl Cmd { )) })?; - snapshot::commit( - state.1, - ledger_info, - &storage.map, - &self.ledger_file, - ) - .map_err(|e| Error::CannotCommitLedgerFile { - filepath: self.ledger_file.clone(), - error: e, + snapshot::commit(state.1, ledger_info, &storage.map, &self.ledger_file).map_err(|e| { + Error::CannotCommitLedgerFile { + filepath: self.ledger_file.clone(), + error: e, + } })?; Ok(res_str) } diff --git a/src/token/wrap.rs b/src/token/wrap.rs index d84ff438b..585fcd1d6 100644 --- a/src/token/wrap.rs +++ b/src/token/wrap.rs @@ -151,15 +151,11 @@ impl Cmd { )) })?; - snapshot::commit( - state.1, - ledger_info, - &storage.map, - &self.ledger_file, - ) - .map_err(|e| Error::CannotCommitLedgerFile { - filepath: self.ledger_file.clone(), - error: e, + snapshot::commit(state.1, ledger_info, &storage.map, &self.ledger_file).map_err(|e| { + Error::CannotCommitLedgerFile { + filepath: self.ledger_file.clone(), + error: e, + } })?; Ok(res_str) } From 3c1a74c1a3e099b5d39910a7e850362912de1ad7 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Thu, 3 Nov 2022 12:06:37 -0700 Subject: [PATCH 18/39] fix --- Makefile | 2 +- src/token/create.rs | 2 +- tests/it/e2e_rpc_server.rs | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 3e57e7da8..8db342984 100644 --- a/Makefile +++ b/Makefile @@ -18,7 +18,7 @@ e2e-test: cargo test --test 'e2e*' -- --ignored check: - cargo clippy --all-targets + cargo clippy --all-targets --target aarch64-apple-darwin watch: cargo watch --clear --watch-when-idle --shell '$(MAKE)' diff --git a/src/token/create.rs b/src/token/create.rs index 08dce639a..1b247a574 100644 --- a/src/token/create.rs +++ b/src/token/create.rs @@ -266,7 +266,7 @@ impl Cmd { )?) .await?; - Ok(hex::encode(&contract_id)) + Ok(hex::encode(contract_id)) } } diff --git a/tests/it/e2e_rpc_server.rs b/tests/it/e2e_rpc_server.rs index 35e836977..29b39ebe9 100644 --- a/tests/it/e2e_rpc_server.rs +++ b/tests/it/e2e_rpc_server.rs @@ -33,7 +33,7 @@ fn create_and_invoke_token_contract_against_rpc_server() { // This test assumes a fresh standalone network rpc server on port 8000 Standalone::new_cmd() - .args(&[ + .args([ "token", "create", "--name=Stellar Lumens", @@ -46,7 +46,7 @@ fn create_and_invoke_token_contract_against_rpc_server() { .success(); Standalone::new_cmd() - .args(&[ + .args([ "invoke", "--id=8af3f0c5c2c4b5a3c6ac67b390f84d9db843b48827376f42e5bad215c42588f7", "--fn=symbol", From 606c61a3b77c947b39bfcafeca2ea3618a1f75ea Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Thu, 3 Nov 2022 12:06:50 -0700 Subject: [PATCH 19/39] undo --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 8db342984..3e57e7da8 100644 --- a/Makefile +++ b/Makefile @@ -18,7 +18,7 @@ e2e-test: cargo test --test 'e2e*' -- --ignored check: - cargo clippy --all-targets --target aarch64-apple-darwin + cargo clippy --all-targets watch: cargo watch --clear --watch-when-idle --shell '$(MAKE)' From cdf5bf9954fa3a2d20f5d570bbf0aa162e5cdd79 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Thu, 3 Nov 2022 12:12:54 -0700 Subject: [PATCH 20/39] reenable --- .github/workflows/publish.yml | 2 +- .github/workflows/rust.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 836a2b113..078ef8b3c 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -3,7 +3,7 @@ name: Publish on: release: types: [published] - # pull_request: + pull_request: defaults: run: diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 15026ce2d..74443e565 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -92,7 +92,7 @@ jobs: - run: cargo test --test it --target ${{ matrix.target }} -- e2e_rpc_server --ignored --test-threads 1 publish-dry-run: - if: startsWith(github.head_ref, 'release/') + # if: startsWith(github.head_ref, 'release/') strategy: matrix: include: From 3867ae215f117a062284ba93f36908a44bcdc1c3 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Thu, 3 Nov 2022 12:22:52 -0700 Subject: [PATCH 21/39] targetg --- .github/workflows/rust.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 74443e565..ab8d3cca2 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -112,7 +112,7 @@ jobs: target: x86_64-pc-windows-msvc test: true # TODO: Pass through whether tests should be run or not. - uses: stellar/actions/.github/workflows/rust-publish-dry-run.yml@main + uses: stellar/actions/.github/workflows/rust-publish-dry-run.yml@publishdryrunalltheplatforms with: runs-on: ${{ matrix.os }} - cargo-package-options: --target ${{ matrix.target }} + target: ${{ matrix.target }} From 5c7b9ea39ba6256f7fff268100a6a9b0a21d83f9 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Thu, 3 Nov 2022 14:09:51 -0700 Subject: [PATCH 22/39] fix --- .github/workflows/publish.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 078ef8b3c..42870900b 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -45,6 +45,8 @@ jobs: - name: Package run: cargo package --no-verify - name: Build + env: + CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc run: | cd target/package tar xvfz soroban-cli-$VERSION.crate From 780ddcd8ba2e634b30e62edd11ed5444f7a807e2 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Thu, 3 Nov 2022 15:03:20 -0700 Subject: [PATCH 23/39] move things about --- .github/workflows/publish.yml | 5 ++--- .github/workflows/rust.yml | 18 +++--------------- 2 files changed, 5 insertions(+), 18 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 42870900b..2ec287867 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -24,7 +24,6 @@ jobs: target: x86_64-unknown-linux-gnu - os: ubuntu-latest target: aarch64-unknown-linux-gnu - apt-install: gcc-aarch64-linux-gnu g++-aarch64-linux-gnu - os: macos-latest target: x86_64-apple-darwin - os: macos-latest @@ -40,8 +39,8 @@ jobs: - uses: actions/checkout@v3 - run: rustup update - run: rustup target add ${{ matrix.target }} - - if: matrix.apt-install - run: sudo apt-get -y install ${{ matrix.apt-install }} + - if: matrix.target == 'aarch64-unknown-linux-gnu' + run: sudo apt-get -y install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu - name: Package run: cargo package --no-verify - name: Build diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index ab8d3cca2..d9e46408d 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -44,31 +44,25 @@ jobs: include: - os: ubuntu-latest target: x86_64-unknown-linux-gnu - test: true - os: ubuntu-latest target: aarch64-unknown-linux-gnu - apt-install: gcc-aarch64-linux-gnu g++-aarch64-linux-gnu - test: false - os: macos-latest target: x86_64-apple-darwin - test: true - os: macos-latest target: aarch64-apple-darwin - test: false - os: windows-latest target: x86_64-pc-windows-msvc - test: true runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 - uses: stellar/actions/rust-cache@main - run: rustup update - run: rustup target add ${{ matrix.target }} - - if: matrix.apt-install - run: sudo apt-get -y install ${{ matrix.apt-install }} + - if: matrix.target == 'aarch64-unknown-linux-gnu' + run: sudo apt-get -y install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu - run: cargo clippy --all-targets --target ${{ matrix.target }} - run: make build-test-wasms - - if: matrix.test + - if: startsWith(matrix.target, 'x86_64') run: cargo test --workspace --target ${{ matrix.target }} e2e-test: @@ -98,20 +92,14 @@ jobs: include: - os: ubuntu-latest target: x86_64-unknown-linux-gnu - test: true - os: ubuntu-latest target: aarch64-unknown-linux-gnu - test: false - os: macos-latest target: x86_64-apple-darwin - test: true - os: macos-latest target: aarch64-apple-darwin - test: false - os: windows-latest target: x86_64-pc-windows-msvc - test: true - # TODO: Pass through whether tests should be run or not. uses: stellar/actions/.github/workflows/rust-publish-dry-run.yml@publishdryrunalltheplatforms with: runs-on: ${{ matrix.os }} From 741477dd9f3147ecc8c3fe67971d5019b9935c44 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Thu, 3 Nov 2022 15:49:52 -0700 Subject: [PATCH 24/39] empty commit From 3f9ba6d3cd77afa4c1a10b93f9d426e3551e9482 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Thu, 3 Nov 2022 16:12:54 -0700 Subject: [PATCH 25/39] empty commit From d42035fab5dbfc3bbfb52a75331f0f311b5837af Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Thu, 3 Nov 2022 16:15:19 -0700 Subject: [PATCH 26/39] empty commit From bffe99dcc788b8befa23f3259141bd8a8ff9466e Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Thu, 3 Nov 2022 16:20:06 -0700 Subject: [PATCH 27/39] empty commit From 7a0bb9d2490e4367d474b34aed04dab6c0affb0f Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Thu, 3 Nov 2022 16:35:46 -0700 Subject: [PATCH 28/39] empty commit From b3c147b1f2f76daa922c779698572f3d8bd58c1a Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Thu, 3 Nov 2022 18:15:45 -0700 Subject: [PATCH 29/39] empty commit From 4ae115cb469bf4109d0ed0e41040aec818a177a0 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Thu, 3 Nov 2022 20:03:46 -0700 Subject: [PATCH 30/39] empty commit From 83c9f723d57e126c6ecf6375174d65049cb962b1 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Thu, 3 Nov 2022 20:11:29 -0700 Subject: [PATCH 31/39] empty commit From 4b14ce72daccfaf4bc8ddef0439bc052edaa8219 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Thu, 3 Nov 2022 20:18:27 -0700 Subject: [PATCH 32/39] empty commit From 1915395684cf449fa16b233c1d59cb6a1367da18 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Thu, 3 Nov 2022 20:21:36 -0700 Subject: [PATCH 33/39] empty commit From 34fc0994eab3c229f485e51c911642f4dd9f9954 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Thu, 3 Nov 2022 20:28:45 -0700 Subject: [PATCH 34/39] empty commit From 3058e3f9e2542a6db1328694173cb953f68ada96 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Thu, 3 Nov 2022 20:37:22 -0700 Subject: [PATCH 35/39] empty commit From af7b8f70ae921f8a40cda166397ec65aab9cbf09 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Thu, 3 Nov 2022 21:00:58 -0700 Subject: [PATCH 36/39] try fixing lf<>crlf --- .gitattributes | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..012d1ba87 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +Cargo.lock text -merge eol=lf From 769de44e6dacd3e17ce7ee09304475fed6f4acae Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Thu, 3 Nov 2022 21:15:07 -0700 Subject: [PATCH 37/39] empty commit From 1351538bf753c9098db9e3d8e4100a0f07711be6 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Thu, 3 Nov 2022 22:44:26 -0700 Subject: [PATCH 38/39] ready for merge --- .github/workflows/publish.yml | 37 +++++++++++++++++------------------ .github/workflows/rust.yml | 4 ++-- 2 files changed, 20 insertions(+), 21 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 2ec287867..9cdc00d88 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -3,7 +3,6 @@ name: Publish on: release: types: [published] - pull_request: defaults: run: @@ -11,10 +10,10 @@ defaults: jobs: - # publish: - # uses: stellar/actions/.github/workflows/rust-publish.yml@main - # secrets: - # CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} + publish: + uses: stellar/actions/.github/workflows/rust-publish.yml@main + secrets: + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} upload: strategy: @@ -33,7 +32,7 @@ jobs: ext: .exe runs-on: ${{ matrix.os }} env: - VERSION: '0.1.2' # '${{ github.event.release.release.name }}' + VERSION: '${{ github.event.release.release.name }}' NAME: 'soroban-cli-${{ github.event.release.release.name }}-${{ matrix.target }}' steps: - uses: actions/checkout@v3 @@ -53,17 +52,17 @@ jobs: cargo build --target-dir=../.. --release --target ${{ matrix.target }} - uses: actions/upload-artifact@v3 with: - name: soroban-${{ matrix.os }}-${{ matrix.target }}-${{ matrix.runs-on }} + name: ${{ env.NAME }} path: 'target/${{ matrix.target }}/release/soroban${{ matrix.ext }}' - # - name: Upload - # uses: actions/github-script@v6 - # with: - # script: | - # const fs = require('fs'); - # await github.rest.repos.uploadReleaseAsset({ - # owner: context.repo.owner, - # repo: context.repo.repo, - # release_id: ${{ github.event.release.release.id }}, - # name: '${{ env.NAME }}${{ matrix.ext }}', - # data: fs.readFileSync('target/${{ matrix.target }}/release/soroban${{ matrix.ext }}'), - # }); + - name: Upload + uses: actions/github-script@v6 + with: + script: | + const fs = require('fs'); + await github.rest.repos.uploadReleaseAsset({ + owner: context.repo.owner, + repo: context.repo.repo, + release_id: ${{ github.event.release.release.id }}, + name: '${{ env.NAME }}${{ matrix.ext }}', + data: fs.readFileSync('target/${{ matrix.target }}/release/soroban${{ matrix.ext }}'), + }); diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index d9e46408d..8299eb563 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -86,7 +86,7 @@ jobs: - run: cargo test --test it --target ${{ matrix.target }} -- e2e_rpc_server --ignored --test-threads 1 publish-dry-run: - # if: startsWith(github.head_ref, 'release/') + if: startsWith(github.head_ref, 'release/') strategy: matrix: include: @@ -100,7 +100,7 @@ jobs: target: aarch64-apple-darwin - os: windows-latest target: x86_64-pc-windows-msvc - uses: stellar/actions/.github/workflows/rust-publish-dry-run.yml@publishdryrunalltheplatforms + uses: stellar/actions/.github/workflows/rust-publish-dry-run.yml@main with: runs-on: ${{ matrix.os }} target: ${{ matrix.target }} From cd835b5df05c965747b26dc2e6e8fefcf9bf6c1e Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Thu, 3 Nov 2022 22:53:17 -0700 Subject: [PATCH 39/39] upd when publish dry run runs to match sdk --- .github/workflows/rust.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 8299eb563..bcc59cf90 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -2,7 +2,7 @@ name: Rust on: push: - branches: [main] + branches: [main, release/**] pull_request: env: @@ -86,7 +86,7 @@ jobs: - run: cargo test --test it --target ${{ matrix.target }} -- e2e_rpc_server --ignored --test-threads 1 publish-dry-run: - if: startsWith(github.head_ref, 'release/') + if: github.event_name == 'push' || startsWith(github.head_ref, 'release/') strategy: matrix: include: