Skip to content

Commit

Permalink
add workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
wisarmy committed Nov 23, 2024
1 parent 612666c commit c2b3eab
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 8 deletions.
72 changes: 72 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Release

on:
push:
tags:
- "v*"

jobs:
release:
name: Release - ${{ matrix.platform.release_for }}
runs-on: ${{ matrix.platform.os }}
strategy:
matrix:
platform:
- release_for: Linux-x86_64
os: ubuntu-latest
target: x86_64-unknown-linux-gnu
bin: raytx
name: raytx-linux-amd64

- release_for: Windows-x86_64
os: windows-latest
target: x86_64-pc-windows-msvc
bin: raytx.exe
name: raytx-windows-amd64.exe

- release_for: macOS-x86_64
os: macos-latest
target: x86_64-apple-darwin
bin: raytx
name: raytx-macos-amd64

- release_for: macOS-aarch64
os: macos-latest
target: aarch64-apple-darwin
bin: raytx
name: raytx-macos-arm64

steps:
- uses: actions/checkout@v4

- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.platform.target }}

- name: Build
run: |
cargo build --release --target ${{ matrix.platform.target }}
- name: Prepare assets
shell: bash
run: |
cd target/${{ matrix.platform.target }}/release
mv ${{ matrix.platform.bin }} ${{ matrix.platform.name }}
- name: Generate SHA256
shell: bash
run: |
cd target/${{ matrix.platform.target }}/release
sha256sum ${{ matrix.platform.name }} > ${{ matrix.platform.name }}.sha256
- name: Upload binaries to release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: |
target/${{ matrix.platform.target }}/release/${{ matrix.platform.name }}
target/${{ matrix.platform.target }}/release/${{ matrix.platform.name }}.sha256
draft: false
prerelease: false
9 changes: 1 addition & 8 deletions src/raydium.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,16 +258,9 @@ impl Raydium {
// sol <-> wsol support
let mut wsol_account = None;
if token_in == native_mint || token_out == native_mint {
// create tmp wsol account
// let wsol_keypair = Keypair::new();
// wsol_account = Some(wsol_keypair.pubkey());

// 生成一个随机的32字节种子
// create wsol account
let seed = &format!("{}", Keypair::new().pubkey())[..32];

// 使用 create_with_seed 派生地址
let wsol_pubkey = Pubkey::create_with_seed(&owner, seed, &spl_token::id())?;

wsol_account = Some(wsol_pubkey);

// LAMPORTS_PER_SOL / 100 // 0.01 SOL as rent
Expand Down

0 comments on commit c2b3eab

Please sign in to comment.