-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* wip: add rust sdk generation * wip: update generated code * Update kinobi release * Update generated code * Add tests * Add readme * Tweak dependency versions * Add rust sdk workflows * Use program builds * Run sdk workflows in parallel * Rename program crate * Update generated clients * Fix program name * Fix binary name * Update description * Fix markdown * Bump kinobi version * Bump kinobi version * Update generated clients * Update examples * Add note on builders * Increase compute units * Fix print test * Rename client workflows * Refactor clients CI * Updata shank version * Tweaks * Pass all arguments to test * Update size config * Add size information * Use size constants --------- Co-authored-by: febo <[email protected]>
- Loading branch information
Showing
224 changed files
with
59,577 additions
and
1,176 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
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 |
---|---|---|
@@ -0,0 +1,65 @@ | ||
name: Build Rust Client | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
rust: | ||
type: string | ||
solana: | ||
type: string | ||
workflow_dispatch: | ||
inputs: | ||
rust: | ||
description: Rust version | ||
default: 1.68.0 | ||
required: true | ||
type: string | ||
solana: | ||
description: Solana version | ||
default: 1.16.8 | ||
required: true | ||
type: string | ||
|
||
env: | ||
CACHE: true | ||
|
||
jobs: | ||
build_sdk: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Git checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Load environment variables | ||
run: cat .github/.env >> $GITHUB_ENV | ||
|
||
- name: Install Rust | ||
uses: metaplex-foundation/actions/install-rust@v1 | ||
with: | ||
toolchain: ${{ inputs.rust || env.RUST_VERSION }} | ||
|
||
- name: Install Solana | ||
uses: metaplex-foundation/actions/install-solana@v1 | ||
with: | ||
version: ${{ inputs.solana || env.SOLANA_VERSION }} | ||
cache: ${{ env.CACHE }} | ||
|
||
- name: Run cargo clippy | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: clippy | ||
args: --all-targets --all-features --no-deps --manifest-path ./clients/rust/Cargo.toml | ||
|
||
- name: Build Rust client | ||
shell: bash | ||
working-directory: clients/rust | ||
run: cargo build --release | ||
|
||
- name: Upload Rust client builds | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: rust-client-builds | ||
# First wildcard ensures exported paths are consistently under the clients folder. | ||
path: ./client*/rust/target/release/*mpl_token_metadata* | ||
if-no-files-found: error |
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
File renamed without changes.
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 |
---|---|---|
@@ -0,0 +1,92 @@ | ||
name: Deploy Rust Client | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
level: | ||
description: Level | ||
required: true | ||
default: patch | ||
type: choice | ||
options: | ||
- patch | ||
- minor | ||
- major | ||
- rc | ||
- beta | ||
- alpha | ||
- release | ||
- version | ||
version: | ||
description: Version | ||
required: false | ||
type: string | ||
dry_run: | ||
description: Dry run | ||
required: true | ||
default: true | ||
type: boolean | ||
|
||
env: | ||
CACHE: true | ||
|
||
jobs: | ||
build_rust_client: | ||
name: Rust Client | ||
uses: ./.github/workflows/build-rust-client.yml | ||
secrets: inherit | ||
|
||
test_rust_client: | ||
name: Rust Client | ||
needs: build_rust_client | ||
uses: ./.github/workflows/test-rust-client.yml | ||
secrets: inherit | ||
|
||
publish_crate: | ||
name: Rust Client / Publish Crate | ||
runs-on: ubuntu-latest | ||
needs: test_rust_client | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: Git checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
token: ${{ secrets.SVC_TOKEN }} | ||
|
||
- name: Load environment variables | ||
run: cat .github/.env >> $GITHUB_ENV | ||
|
||
- name: Install Rust | ||
uses: metaplex-foundation/actions/install-rust@v1 | ||
with: | ||
toolchain: ${{ env.RUST_VERSION }} | ||
|
||
- name: Install Solana | ||
uses: metaplex-foundation/actions/install-solana@v1 | ||
with: | ||
version: ${{ env.SOLANA_VERSION }} | ||
cache: ${{ env.CACHE }} | ||
|
||
- name: Install cargo-release | ||
uses: metaplex-foundation/actions/install-cargo-release@v1 | ||
with: | ||
cache: ${{ env.CACHE }} | ||
|
||
- name: Publish Crate | ||
working-directory: ./clients/rust | ||
run: | | ||
if [ "${{ inputs.level }}" == "version" ]; then | ||
BUMP=${{ inputs.version }} | ||
else | ||
BUMP=${{ inputs.level }} | ||
fi | ||
if [ "${{ inputs.dry_run }}" == "false" ]; then | ||
OPTIONS="--no-confirm --execute" | ||
fi | ||
if [ "${{ inputs.level }}" == "version" ]; then | ||
cargo login ${{ secrets.CRATES_TOKEN }} | ||
cargo release $BUMP $OPTIONS |
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
File renamed without changes.
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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: Test Rust Client | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
program_matrix: | ||
type: string | ||
|
||
env: | ||
CACHE: true | ||
|
||
jobs: | ||
test_sdk: | ||
name: Test | ||
runs-on: ubuntu-latest-16-cores | ||
steps: | ||
- name: Git checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Load environment variables | ||
run: cat .github/.env >> $GITHUB_ENV | ||
|
||
- name: Install Rust | ||
uses: metaplex-foundation/actions/install-rust@v1 | ||
with: | ||
toolchain: ${{ env.RUST_VERSION }} | ||
|
||
- name: Install Solana | ||
uses: metaplex-foundation/actions/install-solana@v1 | ||
with: | ||
version: ${{ env.SOLANA_VERSION }} | ||
cache: ${{ env.CACHE }} | ||
|
||
- name: Download program builds | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: program-builds | ||
|
||
- name: Run tests | ||
shell: bash | ||
working-directory: configs/client-scripts | ||
run: RUST_LOG=error ./test-rust-client.sh |
Oops, something went wrong.