Build kalypso-cli #20
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
name: Build kalypso-cli | |
on: | |
workflow_dispatch: | |
inputs: | |
kalypso-cli-version: | |
description: 'Kalypso CLI version' | |
default: 'vX.Y.Z-beta.U' | |
jobs: | |
build_linux: | |
name: Build Linux Binaries | |
strategy: | |
matrix: | |
include: | |
- os: 'ubuntu-24.04' | |
runs-on: 'ubicloud' | |
build_type: Release | |
GOOS: linux | |
GOARCH: amd64 | |
rust-image: '821c41ed8d70347b32c2a3e4779fa0f05354773adf627aa388d0904494e0d21f' | |
target: x86_64-unknown-linux-musl | |
# - os: 'ubuntu-24.04' | |
# runs-on: 'ubicloud-standard-2-arm' | |
# build_type: Release | |
# GOOS: linux | |
# GOARCH: arm64 | |
# rust-image: 'd9c3c6f1264a547d84560e06ffd79ed7a799ce0bff0980b26cf10d29af888377' | |
# target: aarch64-unknown-linux-musl | |
runs-on: ${{ matrix.runs-on }} | |
outputs: | |
kalypso-cli-checksum: ${{ steps.kalypso-cli.checksum }} | |
steps: | |
- name: Echo Version | |
run: | | |
echo "Kalypso CLI Version: ${{ github.event.inputs.kalypso-cli-version }}" | |
- name: Clone Repository | |
run: | | |
rm -rf kalypso-unified | |
git clone https://github.com/marlinprotocol/kalypso-unified kalypso-unified | |
- name: Checkout Branch | |
run: | | |
cd kalypso-unified | |
git checkout symbotic-bindings | |
rm -rf .cargo | |
- name: Make Build Script Executable | |
run: chmod +x kalypso-unified/build-${{ matrix.GOARCH }}.sh | |
- name: Build Binaries | |
run: | | |
cd kalypso-unified | |
sudo docker run --rm -v "$(pwd)":/code rust@sha256:${{ matrix.rust-image }} bash -c " | |
/code/build-${{ matrix.GOARCH }}.sh | |
" | |
- name: Install UPX | |
run: | | |
wget https://github.com/upx/upx/releases/download/v4.2.4/upx-4.2.4-${{ matrix.GOARCH }}_linux.tar.xz -O upx.txz | |
mkdir -p upx && tar -xvf upx.txz --strip-components=1 -C upx | |
sudo mv upx/upx /usr/local/bin/ | |
- name: Upload kalypso-cli | |
id: kalypso-cli | |
if: ${{ github.event.inputs.kalypso-cli-version != 'vX.Y.Z-beta.U' }} | |
run: | | |
sudo upx kalypso-unified/target/${{ matrix.target }}/release/kalypso-cli | |
CHECKSUM=$(sha256sum kalypso-unified/target/${{ matrix.target }}/release/kalypso-cli | awk '{print $1;}') | |
echo "::set-output name=checksum::${CHECKSUM}" | |
AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }} \ | |
AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY }} \ | |
aws s3 cp --endpoint-url ${{ secrets.AWS_S3_ENDPOINT }} \ | |
kalypso-unified/target/${{ matrix.target }}/release/kalypso-cli \ | |
s3://artifacts/oyster/binaries/kalypso-cli_${{ github.event.inputs.kalypso-cli-version }}_${{ matrix.GOOS }}_${{ matrix.GOARCH }} |