Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
uses: actions/checkout@v4
with:
ssh-key: ${{ secrets.GH_DEPLOY_KEY }}
repository: 'ssh://[email protected]/${{ github.repository }}'
- name: Setup Anchor
uses: ./.github/actions/anchor
- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion docs/whirlpool/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"scripts": {
"build": "docusaurus build --out-dir dist",
"start": "docusaurus start",
"deploy": "sh ../../scripts/deploy-docs",
"deploy": "../../scripts/deploy-docs",
"clean": "rimraf dist .docusaurus"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion legacy-sdk/common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
},
"scripts": {
"build": "tsc",
"deploy": "sh ../../scripts/deploy-npm",
"deploy": "../../scripts/deploy-npm",
"clean": "rimraf dist"
},
"files": [
Expand Down
2 changes: 1 addition & 1 deletion legacy-sdk/whirlpool/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
},
"scripts": {
"build": "mkdir -p ./src/artifacts && cp -f ../../target/idl/whirlpool.json ./src/artifacts/whirlpool.json && cp -f ../../target/types/whirlpool.ts ./src/artifacts/whirlpool.ts && tsc",
"deploy": "sh ../../scripts/deploy-npm",
"deploy": "../../scripts/deploy-npm",
"clean": "rimraf dist"
},
"files": [
Expand Down
2 changes: 1 addition & 1 deletion rust-sdk/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"scripts": {
"build": "node ./codama.js && cargo build",
"test": "cargo test --lib",
"deploy": "sh ../../scripts/deploy-cargo",
"deploy": "../../scripts/deploy-cargo",
"format": "cargo clippy --fix --allow-dirty --allow-staged && cargo fmt",
"lint": "cargo clippy && cargo fmt --check",
"clean": "cargo clean"
Expand Down
2 changes: 1 addition & 1 deletion rust-sdk/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"scripts": {
"build": "cargo build -p orca_whirlpools_core",
"test": "cargo test -p orca_whirlpools_core --lib",
"deploy": "sh ../../scripts/deploy-cargo",
"deploy": "../../scripts/deploy-cargo",
"format": "cargo clippy --fix --allow-dirty --allow-staged && cargo fmt",
"lint": "cargo clippy && cargo fmt --check",
"clean": "cargo clean -p orca_whirlpools_core"
Expand Down
2 changes: 1 addition & 1 deletion rust-sdk/macros/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"scripts": {
"build": "cargo build",
"test": "cargo test --lib",
"deploy": "sh ../../scripts/deploy-cargo",
"deploy": "../../scripts/deploy-cargo",
"format": "cargo clippy --fix --allow-dirty --allow-staged && cargo fmt",
"lint": "cargo clippy && cargo fmt --check",
"clean": "cargo clean"
Expand Down
2 changes: 1 addition & 1 deletion rust-sdk/whirlpool/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"scripts": {
"build": "cargo build",
"test": "cargo test --lib",
"deploy": "sh ../../scripts/deploy-cargo",
"deploy": "../../scripts/deploy-cargo",
"format": "cargo clippy --fix --allow-dirty --allow-staged && cargo fmt",
"lint": "cargo clippy && cargo fmt --check",
"clean": "cargo clean"
Expand Down
8 changes: 5 additions & 3 deletions scripts/deploy-cargo
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! /bin/bash
set -e
#!/usr/bin/env bash
set -eo pipefail

# Get the local version from Cargo.toml
package_name=$(awk '
Expand All @@ -16,8 +16,10 @@ local_version=$(awk '
# Get the published version from cargo
published_version=$(cargo search $package_name | awk 'NR==1 { gsub(/"/, "", $3); print $3 }')

function semver { echo "$@" | awk -F. '{ printf("%d%03d%03d%03d\n", $1,$2,$3,$4); }'; }

# Compare versions
if [ "$local_version" = "$published_version" ]; then
if [ "$(semver $local_version)" -le "$(semver $published_version)" ]; then
echo "Version $local_version is already published to cargo"
exit 0
fi
Expand Down
10 changes: 6 additions & 4 deletions scripts/deploy-docs
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
#! /usr/bin/env bash
set -e
#!/usr/bin/env bash
set -eo pipefail

# Get the local version from package.json
local_version=$(jq -r ".version" package.json)

# Get the published version from github
published_version=$(curl -s https://orca-so.github.io/whirlpools/ | grep -o '<meta itemprop="version" content="[^"]*"' | cut -d'"' -f4)

function semver { echo "$@" | awk -F. '{ printf("%d%03d%03d%03d\n", $1,$2,$3,$4); }'; }

# Compare versions
if [ "$local_version" = "$published_version" ]; then
if [ "$(semver $local_version)" -le "$(semver $published_version)" ]; then
echo "Version $local_version is already published"
exit 0
fi

# Upload artifact
echo "Publishing version $local_version to gh"
gh-pages -f -d dist -b docs --nojekyll > /dev/null
NODE_DEBUG=gh-pages gh-pages -f -d dist -b docs --nojekyll > /dev/null
8 changes: 5 additions & 3 deletions scripts/deploy-npm
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! /bin/bash
set -e
#!/usr/bin/env bash
set -eo pipefail

# Get the local version from package.json
package_name=$(jq -r ".name" package.json)
Expand All @@ -8,8 +8,10 @@ local_version=$(jq -r ".version" package.json)
# Get the published version from npm
published_version=$(npm view $package_name version 2>/dev/null || true)

function semver { echo "$@" | awk -F. '{ printf("%d%03d%03d%03d\n", $1,$2,$3,$4); }'; }

# Compare versions
if [ "$local_version" = "$published_version" ]; then
if [ "$(semver $local_version)" -le "$(semver $published_version)" ]; then
echo "Version $local_version is already published to npm"
exit 0
fi
Expand Down
2 changes: 1 addition & 1 deletion ts-sdk/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"scripts": {
"build": "node ./codama.js && tsup src/index.ts --format cjs,esm --dts --sourcemap",
"test": "vitest run tests",
"deploy": "sh ../../scripts/deploy-npm",
"deploy": "../../scripts/deploy-npm",
"clean": "rimraf dist src/generated"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion ts-sdk/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"build": "wasm-pack build --release --out-dir ./dist/nodejs --target nodejs && wasm-pack build --release --out-dir ./dist/browser --target browser",
"test": "tsc --noEmit && vitest run tests",
"prepublishOnly": "rimraf dist/nodejs/.gitignore dist/browser/.gitignore",
"deploy": "sh ../../scripts/deploy-npm",
"deploy": "../../scripts/deploy-npm",
"clean": "cargo clean && rimraf dist"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion ts-sdk/whirlpool/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"scripts": {
"build": "tsup src/index.ts --format cjs,esm --dts --sourcemap",
"test": "vitest run tests",
"deploy": "sh ../../scripts/deploy-npm",
"deploy": "../../scripts/deploy-npm",
"clean": "rimraf dist"
},
"dependencies": {
Expand Down