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
14 changes: 14 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": [
"@changesets/changelog-github",
{ "repo": "orca-so/whirlpools" }
],
"commit": false,
"fixed": [["@orca-so/whirlpools-docs*"]],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
25 changes: 25 additions & 0 deletions .changeset/tame-badgers-arrive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
"@orca-so/whirlpools-example-rust-repositioning-bot": patch
"@orca-so/whirlpools-sdk": patch
"@orca-so/whirlpools-rust-integration": patch
"@orca-so/whirlpools-program": patch
"@orca-so/whirlpools-rust": patch
"@orca-so/whirlpools-integration": patch
"@orca-so/whirlpools": patch
"@orca-so/whirlpools-rust-client": patch
"@orca-so/whirlpools-rust-macros": patch
"@orca-so/whirlpools-docs": patch
"@orca-so/whirlpools-sdk-cli": patch
"@orca-so/whirlpools-rust-core": patch
"@orca-so/whirlpools-client": patch
"@orca-so/whirlpools-docs-legacy": patch
"@orca-so/whirlpools-core": patch
"@orca-so/whirlpools-lint": patch
"@orca-so/whirlpools-docs-rust": patch
"@orca-so/whirlpools-docs-ts": patch
"@orca-so/whirlpools-example-ts-next": patch
"@orca-so/common-sdk": patch
"@orca-so/whirlpools-sdk-integration": patch
---

Initial changeset version
1 change: 1 addition & 0 deletions .github/actions/anchor/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ runs:
with:
node-version: ${{ inputs.node-version }}
cache: 'yarn'
registry-url: 'https://registry.npmjs.org'
- name: Install Solana CLI
run: |
wget -qO- "https://release.anza.xyz/${{ inputs.solana-version }}/solana-release-x86_64-unknown-linux-gnu.tar.bz2" | tar -xvj
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/cleanup/action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 'Setup Version in monorepo'
description: 'Set version of all packages in monorepo.'
name: 'Cleanup'
description: 'Remove unnecessary files from the build environment.'

branding:
icon: trash-2
Expand Down
34 changes: 34 additions & 0 deletions .github/actions/sync/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: 'Sync Versions'
description: 'Sync npm verison numbers with other package managers.'

branding:
icon: refresh-cw
color: green

runs:
using: "composite"
steps:
- name: Sync Cargo Versions
run: |
find . -type f -name "package.json" -not -path "*/node_modules/*" -exec sh -c '
for file do
cargo_file=$(dirname "$file")/Cargo.toml
version=$(jq -r ".version" "$file")
if [ -f "$cargo_file" ]; then
awk -v version="$version" '\''
/^\[package\]/ { in_package=1 }
/^\[/ && !/^\[package\]/ { in_package=0 }
in_package && /^version = / { sub(/".*"/, "\"" version "\"") } { print }
'\'' "$cargo_file" > tmp.toml && mv tmp.toml "$cargo_file"
fi
done
' _ {} +
shell: bash
- name: Push Changes
run: |
if [[ $(git status --porcelain) ]]; then
git add **/Cargo.toml
git commit -m "Sync cargo versions"
git push
fi
shell: bash
63 changes: 0 additions & 63 deletions .github/actions/version/action.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Dependabot
name: Automerge

on:
pull_request:
Expand All @@ -8,7 +8,7 @@ jobs:

automerge:
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
if: ${{ github.actor == 'dependabot[bot]' || github.actor == 'github-actions[bot]' }}
permissions:
pull-requests: write
contents: write
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,16 @@ jobs:
run: yarn install
- name: Run Lint
run: yarn lint --output-style static

changeset:
runs-on: ubuntu-latest
if: ${{ github.actor != 'dependabot[bot]' && github.actor != 'github-actions[bot]' }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install dependencies
run: yarn install
- name: Check changesets
run: yarn changeset status --since origin/main
35 changes: 0 additions & 35 deletions .github/workflows/docs.yml

This file was deleted.

124 changes: 26 additions & 98 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,107 +2,35 @@ name: Publish

on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
branches: [main]

jobs:

npm:
strategy:
matrix:
package: [core, client, whirlpool]
max-parallel: 1
fail-fast: true
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Anchor
uses: ./.github/actions/anchor
- name: Set Version
uses: ./.github/actions/version
with:
version: ${{ github.ref }}
manifest-file: ts-sdk/${{ matrix.package }}/package.json
- name: Setup npm
run: npm config set //registry.npmjs.org/:_authToken ${{ secrets.NPM_TOKEN }}
- name: Setup yarn
run: yarn config set enableImmutableInstalls false
- name: Install dependencies
run: yarn install
- name: Build package
run: yarn build ts-sdk/${{ matrix.package }} --output-style static
- name: Publish package
working-directory: ts-sdk/${{ matrix.package }}
run: npm publish --access public
concurrency: ${{ github.workflow }}-${{ github.ref }}

cargo:
strategy:
matrix:
package: [macros, core, client, whirlpool]
max-parallel: 1
fail-fast: true
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Anchor
uses: ./.github/actions/anchor
- name: Set Version
uses: ./.github/actions/version
with:
version: ${{ github.ref }}
manifest-file: rust-sdk/${{ matrix.package }}/Cargo.toml
- name: Install dependencies
run: yarn install
- name: Build package
run: yarn build rust-sdk/${{ matrix.package }} --output-style static
- name: Publish package
working-directory: rust-sdk/${{ matrix.package }}
run: cargo publish --allow-dirty
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_TOKEN }}

idl:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Anchor
uses: ./.github/actions/anchor
- name: Build idl
run: anchor build
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: idl
path: target/idl/*.json
if-no-files-found: error

release:
needs: [npm, cargo, idl]
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
outputs:
published: ${{ steps.changesets.outputs.published }}
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
id: idl
with:
name: idl
- name: Create Release Name
id: name
run: echo "NAME=SDK - $(basename ${{ github.ref_name }})" >> $GITHUB_OUTPUT
- name: Create Release
uses: ncipollo/release-action@v1
with:
name: ${{ steps.name.outputs.NAME }}
generateReleaseNotes: true
allowUpdates: true
artifacts: ${{ steps.idl.outputs.download-path }}/idl.zip
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Anchor
uses: ./.github/actions/anchor
- name: Install dependencies
run: yarn install
- name: Create Release Pull Request or Publish
id: changesets
uses: changesets/action@v1
with:
commit: 'Publish packages'
title: 'Publish packages'
publish: 'yarn publish'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_TOKEN }}
- name: Update Cargo Version Numbers
uses: ./.github/actions/sync
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ If you look closely, the commands just call individual commands specified in the

If you want to stream the logs of a specific command you can add the `--output-style stream` flag to the command. This allows you to view the logs of the command as they are being produced which can be useful for longer running tasks like integration tests.

### Changesets

When contributing to this repository, please include a changeset with your changes. You can create a changeset by running `yarn changeset`. If your changes are not related to any of the packages, you can create an empty changeset by running `yarn changeset --empty`. In your pull request, you do not have to manually update the version numbers.

When changes are detected in main, `changesets` will automatically create a pull request to update the version of the packages. Once that pull request is merged, the packages will be published to the npm and cargo automatically.

# Support

### Questions
Expand Down
3 changes: 2 additions & 1 deletion docs/legacy/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{
"name": "@orca-so/whirlpools-docs-legacy",
"version": "0.0.0",
"version": "0.1.0",
"private": true,
"scripts": {
"build": "typedoc",
"start": "typedoc && open dist/legacy/index.html",
"clean": "rimraf dist"
},
"devDependencies": {
"@orca-so/common-sdk": "*",
"@orca-so/whirlpools-sdk": "*",
"typedoc": "^0.27.6",
"typescript": "^5.7.3"
Expand Down
5 changes: 4 additions & 1 deletion docs/legacy/typedoc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"entryPoints": ["../../legacy-sdk/whirlpool/src/index.ts"],
"entryPoints": [
"../../legacy-sdk/common/src/index.ts",
"../../legacy-sdk/whirlpool/src/index.ts"
],
"entryPointStrategy": "resolve",
"githubPages": false,
"skipErrorChecking": true,
Expand Down
Loading
Loading