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/.env
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ NODE_VERSION=20.x
PROGRAMS=["program"]
RUST_VERSION=1.75.0
SOLANA_VERSION=1.17.22
VERIFY_BUILD_VERSION=0.2.11
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @richardwu @samuelvanderwaal
* @richardwu @nftechie @leantOnSol
2 changes: 1 addition & 1 deletion .github/file-filters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# Programs.

program_common: &program_common
- ".github/workflows/build-programs.yml"
- ".github/workflows/build-verify-programs.yml"
- ".github/workflows/test-programs.yml"
- ".github/workflows/main.yml"
- ".github/file-filters.yml"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-rust-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
toolchain: ${{ inputs.rust || env.RUST_VERSION }}

- name: Install Solana
uses: tensor-foundation/actions/install-solana@v2
uses: tensor-foundation/actions/install-solana@v3
with:
version: ${{ inputs.solana || env.SOLANA_VERSION }}
cache: ${{ env.CACHE }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build Programs
name: Build Verify Programs

on:
workflow_call:
Expand Down Expand Up @@ -26,14 +26,19 @@ on:
default: 20.x
required: true
type: string
verify:
description: Verify build version
default: 0.2.11
required: true
type: string

env:
CACHE: true
CARGO_NET_GIT_FETCH_WITH_CLI: "true"
RPC: ${{ secrets.SOLANA_MAINNET_RPC_URL }}

jobs:
build_programs:
build_verify_programs:
name: Build
runs-on: ubuntu-latest
steps:
Expand All @@ -54,7 +59,7 @@ jobs:
toolchain: ${{ inputs.rust || env.RUST_VERSION }}

- name: Install Solana
uses: tensor-foundation/actions/install-solana@v2
uses: tensor-foundation/actions/install-solana@v3
with:
version: ${{ inputs.solana || env.SOLANA_VERSION }}
cache: ${{ env.CACHE }}
Expand All @@ -72,15 +77,32 @@ jobs:
with:
folder: "."
key: programs

- name: Dump mainnet binaries
run: pnpm programs:dump_binaries

- name: Cache solana-verify
uses: actions/cache@v4
id: cache-verify
with:
path: /home/runner/.cargo-install/solana-verify
key: solana-verify-${{ inputs.verify || env.VERIFY_BUILD_VERSION }}-${{ runner.os }}

- name: Install verify build
if: steps.cache-verify.outputs.cache-hit != 'true'
run: cargo install solana-verify --force --root /home/runner/.cargo-install/solana-verify --version ${{ inputs.verify || env.VERIFY_BUILD_VERSION }} --locked

- name: Build programs
- name: Verify build program
shell: bash
run: pnpm programs:build
run: |
/home/runner/.cargo-install/solana-verify/bin/solana-verify build --library-name whitelist_program | tee >(tail -n 1 > build_hash.txt)

- name: Upload programs build
uses: actions/upload-artifact@v4
with:
name: programs-build
# First wildcard ensures exported paths are consistently under the programs folder.
path: ./targe*/deploy/*.so
path: |
./targe*/deploy/*.so
build_hash.txt
if-no-files-found: error
8 changes: 4 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,11 @@ jobs:
command: clippy
args: --all-targets --all-features --no-deps -- -D warnings

build_programs:
build_verify_programs:
name: Programs
if: ${{ needs.changes.outputs.any == 'true' }}
needs: [changes, lint_js, lint_rust]
uses: ./.github/workflows/build-programs.yml
uses: ./.github/workflows/build-verify-programs.yml
secrets: inherit

test_programs:
Expand All @@ -153,7 +153,7 @@ jobs:
generate_clients:
name: Generate Clients
if: ${{ needs.changes.outputs.any == 'true' }}
needs: [changes, build_programs]
needs: [changes, build_verify_programs]
runs-on: ubuntu-latest
steps:
- name: Git checkout
Expand All @@ -171,7 +171,7 @@ jobs:
toolchain: ${{ env.RUST_VERSION }}

- name: Install Solana
uses: tensor-foundation/actions/install-solana@v2
uses: tensor-foundation/actions/install-solana@v3
with:
version: ${{ env.SOLANA_VERSION }}
cache: ${{ env.CACHE }}
Expand Down
80 changes: 14 additions & 66 deletions .github/workflows/publish-js-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,13 @@ name: Publish JS Client
on:
workflow_dispatch:
inputs:
bump:
description: Version bump
required: true
default: patch
type: choice
options:
- patch
- minor
- major
- prerelease
- prepatch
- preminor
- premajor
tag:
description: NPM Tag (and preid for pre-releases)
description: NPM Tag
required: true
type: string
default: latest
create_release:
description: Create a GitHub release
dry_run:
description: Dry run
required: true
type: boolean
default: true
Expand All @@ -31,19 +18,22 @@ env:
CACHE: true

jobs:
build_programs:
build_verify_programs:
name: Programs
uses: ./.github/workflows/build-programs.yml
if: github.ref == 'refs/heads/main' || inputs.dry_run == true
uses: ./.github/workflows/build-verify-programs.yml
secrets: inherit

test_js:
name: JS client
needs: build_programs
if: github.ref == 'refs/heads/main' || inputs.dry_run == true
needs: build_verify_programs
uses: ./.github/workflows/test-js-client.yml
secrets: inherit

publish_js:
name: JS client / Publish
if: github.ref == 'refs/heads/main' || inputs.dry_run == true
runs-on: ubuntu-latest
needs: test_js
permissions:
Expand Down Expand Up @@ -71,17 +61,11 @@ jobs:
- name: Build
working-directory: ./clients/js
run: pnpm build

- name: Bump
id: bump
- name: Get version
id: get_version
working-directory: ./clients/js
run: |
if [ "${{ startsWith(inputs.bump, 'pre') }}" == "true" ]; then
pnpm version ${{ inputs.bump }} --preid ${{ inputs.tag }} --no-git-tag-version
else
pnpm version ${{ inputs.bump }} --no-git-tag-version
fi
echo "new_version=$(pnpm pkg get version | sed 's/"//g')" >> $GITHUB_OUTPUT
run: echo "version=$(pnpm pkg get version | sed 's/"//g')" >> $GITHUB_OUTPUT

- name: Set publishing config
run: pnpm config set '//registry.npmjs.org/:_authToken' "${NODE_AUTH_TOKEN}"
Expand All @@ -90,40 +74,4 @@ jobs:

- name: Publish
working-directory: ./clients/js
run: pnpm publish --no-git-checks --tag ${{ inputs.tag }}

- name: Commit and tag new version
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Deploy JS client v${{ steps.bump.outputs.new_version }}
tagging_message: js@v${{ steps.bump.outputs.new_version }}

- name: Create GitHub release
if: github.event.inputs.create_release == 'true'
uses: ncipollo/release-action@v1
with:
tag: js@v${{ steps.bump.outputs.new_version }}

deploy_js_docs:
name: JS client / Deploy docs
runs-on: ubuntu-latest
needs: publish_js
environment:
name: js-client-documentation
url: ${{ steps.deploy.outputs.url }}
steps:
- name: Git checkout
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}

- name: Load environment variables
run: cat .github/.env >> $GITHUB_ENV

- name: Deploy to Vercel
id: deploy
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
working-directory: ./clients/js
run: echo "url=$(vercel deploy --prod --token=${{ secrets.VERCEL_TOKEN }})" | tee $GITHUB_OUTPUT

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No more JS docs?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

out of scope atm, we haven't deployed + hosted SDK docs - can work on that eventually in the future

run: pnpm publish --no-git-checks --tag ${{ inputs.tag }} ${{ inputs.dry_run && '--dry-run' || '' }}
6 changes: 3 additions & 3 deletions .github/workflows/publish-rust-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ env:
CACHE: true

jobs:
build_programs:
build_verify_programs:
name: Programs
uses: ./.github/workflows/build-programs.yml
uses: ./.github/workflows/build-verify-programs.yml
secrets: inherit

build_rust_client:
Expand All @@ -43,7 +43,7 @@ jobs:

test_rust_client:
name: Rust Client
needs: [build_programs, build_rust_client]
needs: [build_verify_programs, build_rust_client]
uses: ./.github/workflows/test-rust-client.yml
secrets: inherit

Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/test-js-anchor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ jobs:
matrix:
node:
- glob: tests/twhitelist/whitelist.test.ts
- glob: tests/twhitelist/mint_proof.test.ts
- glob: tests/twhitelist/merkle_tree.test.ts

steps:
Expand All @@ -27,7 +26,7 @@ jobs:
run: cat .github/.env >> $GITHUB_ENV

- name: Start validator
uses: tensor-foundation/actions/start-validator@v2
uses: tensor-foundation/actions/start-validator@v3
with:
node: "18.x"
solana: ${{ env.SOLANA_VERSION }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-js-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
run: cat .github/.env >> $GITHUB_ENV

- name: Start validator
uses: tensor-foundation/actions/start-validator@v2
uses: tensor-foundation/actions/start-validator@v3
with:
node: ${{ matrix.node }}
solana: ${{ env.SOLANA_VERSION }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-programs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
toolchain: ${{ env.RUST_VERSION }}

- name: Install Solana
uses: tensor-foundation/actions/install-solana@v2
uses: tensor-foundation/actions/install-solana@v3
with:
version: ${{ env.SOLANA_VERSION }}
cache: ${{ env.CACHE }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-rust-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
toolchain: ${{ env.RUST_VERSION }}

- name: Install Solana
uses: tensor-foundation/actions/install-solana@v2
uses: tensor-foundation/actions/install-solana@v3
with:
version: ${{ env.SOLANA_VERSION }}
cache: ${{ env.CACHE }}
Expand Down
Loading