-
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.
- Loading branch information
Showing
10 changed files
with
170 additions
and
82 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
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
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,16 @@ | ||
#!/bin/bash | ||
|
||
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd) | ||
# go to parent folder | ||
cd $(dirname $(dirname $SCRIPT_DIR)) | ||
WORKING_DIR=$(pwd) | ||
|
||
# command-line input | ||
ARGS=$* | ||
|
||
# js client tests folder | ||
cd ${WORKING_DIR}/clients/js | ||
|
||
for t in `ls test/${ARGS}*`; do | ||
pnpm build && pnpm test ${t} | ||
done |
10 changes: 5 additions & 5 deletions
10
configs/program-scripts/sdk.sh → configs/client-scripts/test-rust-client.sh
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,22 +1,22 @@ | ||
#!/bin/bash | ||
|
||
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd) | ||
OUTPUT="./programs/.bin" | ||
PROGRAMS_OUTPUT="./programs/.bin" | ||
# go to parent folder | ||
cd $(dirname $(dirname $SCRIPT_DIR)) | ||
|
||
# default to input from the command-line | ||
# command-line input | ||
ARGS=$* | ||
|
||
WORKING_DIR=$(pwd) | ||
SOLFMT="solfmt" | ||
export SBF_OUT_DIR="${WORKING_DIR}/${OUTPUT}" | ||
export SBF_OUT_DIR="${WORKING_DIR}/${PROGRAMS_OUTPUT}" | ||
|
||
# client SDK tests | ||
cd ${WORKING_DIR}/clients/rust | ||
|
||
if [ ! "$(command -v $SOLFMT)" = "" ]; then | ||
CARGO_TERM_COLOR=always cargo test-sbf --sbf-out-dir ${WORKING_DIR}/${OUTPUT} ${ARGS} 2>&1 | ${SOLFMT} | ||
CARGO_TERM_COLOR=always cargo test-sbf --sbf-out-dir ${WORKING_DIR}/${PROGRAMS_OUTPUT} ${ARGS} 2>&1 | ${SOLFMT} | ||
else | ||
cargo test-sbf --sbf-out-dir ${WORKING_DIR}/${OUTPUT} ${ARGS} | ||
cargo test-sbf --sbf-out-dir ${WORKING_DIR}/${PROGRAMS_OUTPUT} ${ARGS} | ||
fi |
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