Skip to content

Commit

Permalink
Merge master
Browse files Browse the repository at this point in the history
  • Loading branch information
Evan Batsell committed Oct 5, 2023
2 parents b8f8d31 + b9fa959 commit a6bdc8c
Show file tree
Hide file tree
Showing 16 changed files with 479 additions and 325 deletions.
65 changes: 60 additions & 5 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ env:
jobs:
build-and-test:
name: Build and test programs
runs-on: ubuntu-20.04
runs-on: big-runner-1

steps:
# Setup
- uses: actions/checkout@v2
- uses: ./.github/actions/setup/
- uses: ./.github/actions/setup-solana/
Expand All @@ -26,16 +27,70 @@ jobs:
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
./target/
./mev-programs/target/
key: cargo-${{ runner.os }}-anchor-${{ hashFiles('**/Cargo.lock') }}
- run: cargo install --git https://github.com/coral-xyz/anchor --tag v0.27.0 anchor-cli --locked --force
- name: Install yarn dependencies
working-directory: ./mev-programs
run: yarn
- name: Run Anchor test
working-directory: ./mev-programs
run: anchor test
- uses: reinismu/clippy-check@master
with:
working-directory: ./mev-programs/programs
token: ${{ secrets.GITHUB_TOKEN }}

# Build IDLs
- name: Build jito_tip_distribution
working-directory: ./mev-programs
run: anchor build --idl idl --program-name jito_tip_distribution
- name: Build jito_tip_payment
working-directory: ./mev-programs
run: anchor build --idl idl --program-name jito_tip_payment

# Test
- name: Run Anchor test
working-directory: ./mev-programs
run: anchor test

# Make sure no uncommitted changes
- name: Check for diff
run: git diff --exit-code

verified-build:
name: Build Verifiable Artifact
runs-on: big-runner-1
steps:
- name: Checkout
uses: actions/checkout@v3

# --force because the cargo cache has it saved
- name: Install Solana Verify
run: |
cargo install solana-verify --force
solana-verify --version
- name: Verifiable Build
working-directory: ./mev-programs
run: |
solana-verify build --library-name jito_tip_distribution
solana-verify build --library-name jito_tip_payment
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: build
path: |
mev-programs/target/deploy/jito_tip_distribution.so
mev-programs/target/deploy/jito_tip_payment.so
mev-programs/target/idl/jito_tip_distribution.json
mev-programs/target/idl/jito_tip_payment.json
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
working-directory: ./mev-programs
files: |
mev-programs/target/deploy/jito_tip_distribution.so
mev-programs/target/deploy/jito_tip_payment.so
mev-programs/target/idl/jito_tip_distribution.json
mev-programs/target/idl/jito_tip_payment.json
42 changes: 0 additions & 42 deletions .github/workflows/publish.yaml

This file was deleted.

94 changes: 94 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: Release
on:
push:
tags:
- 'v*'

env:
SOLANA_CLI_VERSION: 1.14.17
jobs:
release:
name: Create the jito programs release
runs-on: big-runner-1

steps:
# Setup
- uses: actions/checkout@v2
- uses: ./.github/actions/setup/
- uses: ./.github/actions/setup-solana/
- uses: actions/cache@v2
name: Cache Cargo registry + index
id: cache-anchor
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
./mev-programs/target/
key: cargo-${{ runner.os }}-anchor-${{ hashFiles('**/Cargo.lock') }}
- run: cargo install --git https://github.com/coral-xyz/anchor --tag v0.27.0 anchor-cli --locked --force
- name: Install yarn dependencies
working-directory: ./mev-programs
run: yarn

# Build IDLs
- name: Build jito_tip_distribution
working-directory: ./mev-programs
run: anchor build --idl idl --program-name jito_tip_distribution
- name: Build jito_tip_payment
working-directory: ./mev-programs
run: anchor build --idl idl --program-name jito_tip_payment

# Test
- name: Run Anchor test
working-directory: ./mev-programs
run: anchor test

# Verified build
# --force because the cargo cache has it saved
- name: Install Solana Verify
run: |
cargo install solana-verify --force
solana-verify --version
- name: Verifiable Build
working-directory: ./mev-programs
run: |
solana-verify build --library-name jito_tip_distribution
solana-verify build --library-name jito_tip_payment
# Make sure no uncommitted changes
- name: Check for diff
run: git diff --exit-code

# Push to anchor repository
- name: Anchor Login
working-directory: ./mev-programs
run: anchor login ${{ secrets.ANCHOR_PUBLISH_TOKEN }}
- name: Publish tip-payment source code
working-directory: ./mev-programs
run: yes 'yes' | anchor publish jito_tip_payment --skip-build --provider.cluster mainnet
- name: Publish tip-distribution source code
working-directory: ./mev-programs
run: yes 'yes' | anchor publish jito_tip_distribution --skip-build --provider.cluster mainnet

# Upload artifacts
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: build
path: |
mev-programs/target/deploy/jito_tip_distribution.so
mev-programs/target/deploy/jito_tip_payment.so
mev-programs/target/idl/jito_tip_distribution.json
mev-programs/target/idl/jito_tip_payment.json
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
mev-programs/target/deploy/jito_tip_distribution.so
mev-programs/target/deploy/jito_tip_payment.so
mev-programs/target/idl/jito_tip_distribution.json
mev-programs/target/idl/jito_tip_payment.json
15 changes: 7 additions & 8 deletions mev-programs/Anchor.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ cluster = "localnet"
wallet = "~/.config/solana/id.json"

[programs.mainnet]
tip_distribution = "4R3gSG8BpU4t19KYj8CfnbtRpnT8gtk4dvTHxVRwc2r7"
tip_payment = "T1pyyaTNZsKv2WcRAB8oVnk93mLJw2XzjtVYqCsaHqt"
jito_tip_distribution = "4R3gSG8BpU4t19KYj8CfnbtRpnT8gtk4dvTHxVRwc2r7"
jito_tip_payment = "T1pyyaTNZsKv2WcRAB8oVnk93mLJw2XzjtVYqCsaHqt"

[programs.testnet]
tip_distribution = "F2Zu7QZiTYUhPd7u9ukRVwxh7B71oA3NMJcHuCHc29P2"
tip_payment = "DCN82qDxJAQuSqHhv2BJuAgi41SPeKZB5ioBCTMNDrCC"
jito_tip_distribution = "F2Zu7QZiTYUhPd7u9ukRVwxh7B71oA3NMJcHuCHc29P2"
jito_tip_payment = "DCN82qDxJAQuSqHhv2BJuAgi41SPeKZB5ioBCTMNDrCC"

[programs.localnet]
tip_distribution = "4R3gSG8BpU4t19KYj8CfnbtRpnT8gtk4dvTHxVRwc2r7"
tip_payment = "T1pyyaTNZsKv2WcRAB8oVnk93mLJw2XzjtVYqCsaHqt"
jito_tip_distribution = "4R3gSG8BpU4t19KYj8CfnbtRpnT8gtk4dvTHxVRwc2r7"
jito_tip_payment = "T1pyyaTNZsKv2WcRAB8oVnk93mLJw2XzjtVYqCsaHqt"

[workspace]
members = [
Expand All @@ -28,5 +28,4 @@ url = "https://anchor.projectserum.com"
test = "yarn ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.{ts,js}"

[test.validator]
slots_per_epoch = "128"
ticks_per_slot = 32
slots_per_epoch = "32"
Loading

0 comments on commit a6bdc8c

Please sign in to comment.