-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
28 changed files
with
3,329 additions
and
2,246 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 |
---|---|---|
@@ -1,170 +1,104 @@ | ||
on: | ||
workflow_dispatch: | ||
push: | ||
tags: | ||
- "v*" | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
IMAGE_NAME: plerkle-test-validator | ||
RUST_VERSION: 1.64.0 | ||
SOLANA_VERSION_STABLE: v1.14.15 | ||
|
||
jobs: | ||
release-stable: | ||
runs-on: buildjet-8vcpu-ubuntu-2004 | ||
build20: | ||
# current github actions ubuntu latest is 20.04 | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set env vars | ||
run: | | ||
source ci/env.sh | ||
echo "GEYSER_PLUGIN_NAME=$plugin_name" | tee -a $GITHUB_ENV | ||
echo "GEYSER_PLUGIN_LIB=lib${plugin_lib_name}" | tee -a $GITHUB_ENV | ||
- if: runner.os == 'Linux' | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get upgrade | ||
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - | ||
sudo apt-add-repository "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-10 main" | ||
sudo apt-get update | ||
sudo apt-get install -y libudev-dev libssl-dev libsasl2-dev libzstd-dev | ||
sudo apt-get install -y openssl --allow-unauthenticated | ||
sudo apt-get install -y libssl1.1 --allow-unauthenticated | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: ${{ env.RUST_VERSION }} | ||
override: true | ||
profile: minimal | ||
components: rustfmt | ||
- name: Build Plugin | ||
run: | | ||
echo "CI_TAG=${GITHUB_REF#refs/*/}" >> "$GITHUB_ENV" | ||
echo "CI_OS_NAME=linux" >> "$GITHUB_ENV" | ||
cargo build --release | ||
- name: Build release tarball | ||
run: ./ci/create-tarball.sh | ||
- name: Publish to crates registry | ||
run: | | ||
cargo publish -p plerkle_serialization --token $CARGO_TOKEN --no-verify || true | ||
sleep 30 | ||
cargo publish -p plerkle_messenger --token $CARGO_TOKEN --no-verify || true | ||
shell: bash | ||
env: | ||
CARGO_TOKEN: ${{ secrets.CARGO_TOKEN }} | ||
- name: Release | ||
uses: softprops/action-gh-release@v1 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
with: | ||
name: STABLE ${{ env.CI_TAG }} | ||
body: | | ||
## STABLE VERSION: | ||
Reccomended for Mainnet | ||
${{ env.GEYSER_PLUGIN_NAME }} ${{ env.CI_TAG }} | ||
solana ${{ env.SOLANA_VERSION_STABLE }} | ||
rust ${{ env.RUST_VERSION }} | ||
files: | | ||
${{ env.GEYSER_PLUGIN_NAME }}-release-* | ||
# release-regret: | ||
# runs-on: buildjet-8vcpu-ubuntu-2004 | ||
# steps: | ||
# - uses: actions/checkout@v2 | ||
# - name: Set env vars | ||
# run: | | ||
# source ci/env.sh | ||
# echo "GEYSER_PLUGIN_NAME=$plugin_name" | tee -a $GITHUB_ENV | ||
# echo "GEYSER_PLUGIN_LIB=lib${plugin_lib_name}" | tee -a $GITHUB_ENV | ||
# - if: runner.os == 'Linux' | ||
# run: | | ||
# sudo apt-get update | ||
# sudo apt-get upgrade | ||
# wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - | ||
# sudo apt-add-repository "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-10 main" | ||
# sudo apt-get update | ||
# sudo apt-get install -y libudev-dev libssl-dev libsasl2-dev libzstd-dev | ||
# sudo apt-get install -y openssl --allow-unauthenticated | ||
# sudo apt-get install -y libssl1.1 --allow-unauthenticated | ||
# - uses: actions-rs/toolchain@v1 | ||
# with: | ||
# toolchain: ${{ env.RUST_VERSION_REGRET }} | ||
# override: true | ||
# profile: minimal | ||
# components: rustfmt | ||
# - name: Build Plugin | ||
# run: | | ||
# rm plerkle-release-x86_64-unknown-linux-gnu.tar.bz2 | ||
# echo "CI_TAG=${GITHUB_REF#refs/*/}" >> "$GITHUB_ENV" | ||
# echo "CI_OS_NAME=linux" >> "$GITHUB_ENV" | ||
# cargo build --release | ||
# - name: Build release tarball | ||
# run: ./ci/create-tarball.sh | ||
# - uses: actions-rs/toolchain@v1 | ||
# with: | ||
# toolchain: ${{ env.RUST_VERSION_REGRET }} | ||
# override: true | ||
# profile: minimal | ||
# components: rustfmt | ||
# - name: Build release tarball | ||
# run: ./ci/create-tarball.sh | ||
# - name: Release | ||
# uses: softprops/action-gh-release@v1 | ||
# if: startsWith(github.ref, 'refs/tags/') | ||
# with: | ||
# name: UNSTABLE ${{ env.CI_TAG }} | ||
# body: | | ||
# ## UNSTABLE VERSION: | ||
# Reccomended for Devnet, Testnet | ||
# ${{ env.GEYSER_PLUGIN_NAME }} ${{ env.CI_TAG }} | ||
# solana ${{ env.SOLANA_VERSION_REGRET }} | ||
# rust ${{ env.RUST_VERSION_REGRET }} | ||
# files: | | ||
# ${{ env.GEYSER_PLUGIN_NAME }}-release-* | ||
push-stable: | ||
runs-on: ubuntu-latest | ||
needs: release-stable | ||
permissions: | ||
packages: write | ||
contents: read | ||
- name: checkout repo | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
lfs: true | ||
|
||
- name: set env vars | ||
run: | | ||
source ci/env.sh | ||
echo "RUST_VERSION=$rust_version" | tee -a "$GITHUB_ENV" | ||
echo "RUST_PROFILE=$rust_profile" | tee -a "$GITHUB_ENV" | ||
echo "RUST_COMPONENTS=$rust_components" | tee -a "$GITHUB_ENV" | ||
echo "SOLANA_VERSION=$solana_version" | tee -a "$GITHUB_ENV" | ||
echo "PLUGIN_VERSION=$plugin_version" | tee -a "$GITHUB_ENV" | ||
echo "RELEASE=$release" | tee -a "$GITHUB_ENV" | ||
# echo "TAG=$tag" | tee -a "$GITHUB_ENV" | ||
|
||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: ${{ env.RUST_VERSION }} | ||
override: true | ||
profile: ${{ env.RUST_PROFILE }} | ||
components: ${{ env.RUST_COMPONENTS }} | ||
|
||
- name: Build plerkle plugin | ||
run: cargo build --verbose --release | ||
|
||
- name: Package libplerkle | ||
working-directory: target/release | ||
run: tar -cvjf plerkle-x86_64-unknown-linux-gnu.tar.bz2 libplerkle.so | ||
|
||
- name: Publish to release | ||
if: startsWith(github.ref, 'refs/tags/') | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
name: "${{ env.RELEASE }}" | ||
# tag_name: "${{ env.TAG }}" | ||
token: ${{ github.token }} | ||
body: | | ||
The plugin version is ${{ env.PLUGIN_VERSION }} | ||
The solana-sdk version used to compile this plugin is ${{ env.SOLANA_VERSION }} | ||
The rust version used is ${{ env.RUST_VERSION }} | ||
files: | | ||
target/release/plerkle-x86_64-unknown-linux-gnu.tar.bz2 | ||
build22: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Build image | ||
run: docker build . --file Solana.Dockerfile --tag $IMAGE_NAME --label 'runnumber=${GITHUB_RUN_ID}' | ||
- name: Log in to registry | ||
run: echo '${{ secrets.GITHUB_TOKEN }}' | docker login ghcr.io -u $ --password-stdin | ||
- name: Push image Stable | ||
if: startsWith(github.ref, 'refs/tags/') | ||
run: | | ||
CI_TAG=${GITHUB_REF#refs/*/} | ||
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME | ||
# Change all uppercase to lowercase | ||
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') | ||
# Strip git ref prefix from version | ||
VERSION=$CI_TAG | ||
echo IMAGE_ID=$IMAGE_ID | ||
export TAG=$VERSION-${{ env.RUST_VERSION }}-${{ env.SOLANA_VERSION_STABLE }} | ||
echo VERSION=$TAG | ||
docker tag $IMAGE_NAME $IMAGE_ID:$TAG | ||
docker push $IMAGE_ID:$TAG | ||
# push-regret: | ||
# runs-on: ubuntu-latest | ||
# needs: release-regret | ||
# permissions: | ||
# packages: write | ||
# contents: read | ||
# steps: | ||
# - uses: actions/checkout@v3 | ||
# - name: Build image | ||
# run: docker build --build-arg RUST_VERSION=${{ env.RUST_VERSION_REGRET }} --build-arg SOLANA_VERSION=v${{ env.SOLANA_VERSION_REGRET }} . --file Solana.Dockerfile --tag $IMAGE_NAME --label 'runnumber=${GITHUB_RUN_ID}' | ||
# - name: Log in to registry | ||
# run: echo '${{ secrets.GITHUB_TOKEN }}' | docker login ghcr.io -u $ --password-stdin | ||
# - name: Push image Stable | ||
# if: startsWith(github.ref, 'refs/tags/') | ||
# run: | | ||
# CI_TAG=${GITHUB_REF#refs/*/} | ||
# IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME | ||
# # Change all uppercase to lowercase | ||
# IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') | ||
# # Strip git ref prefix from version | ||
# VERSION=$CI_TAG | ||
# echo IMAGE_ID=$IMAGE_ID | ||
# export TAG=$VERSION-${{ env.RUST_VERSION_REGRET }}-${{ env.SOLANA_VERSION_REGRET }} | ||
# echo VERSION=$TAG | ||
# docker tag $IMAGE_NAME $IMAGE_ID:$TAG | ||
# docker push $IMAGE_ID:$TAG | ||
- name: checkout repo | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
lfs: true | ||
|
||
- name: set env vars | ||
run: | | ||
source ci/env.sh | ||
echo "RUST_VERSION=$rust_version" | tee -a "$GITHUB_ENV" | ||
echo "RUST_PROFILE=$rust_profile" | tee -a "$GITHUB_ENV" | ||
echo "RUST_COMPONENTS=$rust_components" | tee -a "$GITHUB_ENV" | ||
echo "SOLANA_VERSION=$solana_version" | tee -a "$GITHUB_ENV" | ||
echo "PLUGIN_VERSION=$plugin_version" | tee -a "$GITHUB_ENV" | ||
echo "TAG=$tag" | tee -a "$GITHUB_ENV" | ||
echo "RELEASE=$release" | tee -a "$GITHUB_ENV" | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: ${{ env.RUST_VERSION }} | ||
override: true | ||
profile: ${{ env.RUST_PROFILE }} | ||
components: ${{ env.RUST_COMPONENTS }} | ||
|
||
- name: Build plerkle plugin | ||
run: cargo build --verbose --release | ||
|
||
- name: Package libplerkle | ||
working-directory: target/release | ||
run: tar -cvjf plerkle22-x86_64-unknown-linux-gnu.tar.bz2 libplerkle.so | ||
|
||
- name: Publish to release | ||
if: startsWith(github.ref, 'refs/tags/') | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
name: ${{ env.RELEASE }} | ||
# tag_name: ${{ env.TAG }} | ||
token: ${{ github.token }} | ||
body: | | ||
The plugin version is ${{ env.PLUGIN_VERSION }} | ||
The solana-sdk version used to compile this plugin is ${{ env.SOLANA_VERSION }} | ||
The rust version used is ${{ env.RUST_VERSION }} | ||
files: | | ||
target/release/plerkle22-x86_64-unknown-linux-gnu.tar.bz2 |
Oops, something went wrong.