-
Notifications
You must be signed in to change notification settings - Fork 138
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6c41c82
commit 4fc631c
Showing
1 changed file
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: Rust Build and Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- feature/ci_build | ||
|
||
jobs: | ||
build_and_release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
override: true | ||
|
||
# Build cli folder | ||
- name: Build CLI without flashloan | ||
run: | | ||
cd cli | ||
cargo build --release | ||
mv target/release/cli ../cli_without_flashloan | ||
- name: Modify Cargo.toml and Build CLI with flashloan | ||
run: | | ||
sed -i 's/"cmp"/"cmp","flashloan_v2"/g' Cargo.toml | ||
cargo build --release | ||
mv target/release/cli ../cli_with_flashloan | ||
- name: Zip the binaries | ||
run: | | ||
zip cli.zip cli_without_flashloan cli_with_flashloan | ||
- name: Create Release | ||
id: create_release | ||
uses: gh-actions/[email protected] | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: Release ${{ github.ref }} | ||
draft: false | ||
prerelease: false | ||
|
||
- name: Upload zip to Release | ||
uses: gh-actions/[email protected] | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ./cli.zip | ||
asset_name: cli.zip | ||
asset_content_type: application/zip |