Skip to content

Commit

Permalink
feat: cicd
Browse files Browse the repository at this point in the history
  • Loading branch information
mindrunner committed Jan 22, 2025
1 parent 8d65a05 commit 490ab3d
Showing 1 changed file with 105 additions and 0 deletions.
105 changes: 105 additions & 0 deletions .github/workflows/build-and-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
name: Build Agave
on:
push:
branches:
- "**"
tags:
- "v*"

jobs:
build-agave:
name: Build Agave (${{ matrix.arch }})
runs-on: ${{ matrix.runner }}
strategy:
matrix:
include:
- arch: amd64
runner: ubuntu-24.04
target: x86_64-unknown-linux-gnu
- arch: arm64
runner: ubuntu-24.04-arm
target: aarch64-unknown-linux-gnu

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Get source ref
id: get_ref
run: |
if [[ $GITHUB_REF == refs/tags/* ]]; then
echo "ref=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
else
echo "ref=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT
fi
- name: Checkout Agave
uses: actions/checkout@v4
with:
repository: anza-xyz/agave
ref: ${{ steps.get_ref.outputs.ref }}
path: agave
fetch-depth: 0

- name: Install Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
target: ${{ matrix.target }}

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libssl-dev \
libudev-dev \
pkg-config \
zlib1g-dev \
llvm \
clang \
cmake \
make \
libprotobuf-dev \
protobuf-compiler
- name: Build for production
run: |
cd agave
RUSTFLAGS="-C target-feature=+crt-static" \
cargo build --release --target ${{ matrix.target }} \
--features production
- name: Create tarball
run: |
cd agave
mkdir -p release/bin
cp target/${{ matrix.target }}/release/solana* release/bin/
cp target/${{ matrix.target }}/release/agave* release/bin/
tar -cjf "solana-release-${{ matrix.target }}.tar.bz2" -C release .
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: solana-release-${{ matrix.target }}
path: agave/solana-release-${{ matrix.target }}.tar.bz2
if-no-files-found: error

create-release:
needs: build-agave
runs-on: ubuntu-24.04
if: startsWith(github.ref, 'refs/tags/')

steps:
- name: Download all artifacts
uses: actions/download-artifact@v4

- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: |
*/solana-release-*.tar.bz2
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 490ab3d

Please sign in to comment.