Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add core binary upload to cloudflare r2 bucket #2126

Merged
merged 17 commits into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions .github/workflows/build-binaries-and-push-to-r2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Upload core binary to Cloudflare R2 bucket

on:
push:
branches:
- main
workflow_dispatch:
inputs:
branch:
description: Github branch to checkout for build
required: true
default: main
type: string

jobs:
build-and-upload:
name: Build binary and push to R2
runs-on: ubuntu-20.04
permissions:
contents: write
packages: write
id-token: write
steps:
- name: Determine branch
id: get-branch-name
run: |
if [ "${{ github.event_name }}" == "push" ]; then
branch="main"
else
branch="${{ inputs.branch }}"
fi
echo "branch=$branch" >> $GITHUB_OUTPUT

- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: "0"
path: axelar-core
submodules: recursive
ref: ${{ steps.get-branch-name.outputs.branch }}

- name: Build axelard binary with version and commit hash
id: build-binary
run: |
mkdir ./binary_file/
cd axelar-core
make build
maancham marked this conversation as resolved.
Show resolved Hide resolved
semver=$(git describe --tags)
echo "Semantic Version of current binary: $semver"
cd ..
sudo mv axelar-core/bin/axelard ./binary_file/axelard-linux-amd64-$semver
maancham marked this conversation as resolved.
Show resolved Hide resolved
echo "binary-directory=./binary_file" >> $GITHUB_OUTPUT
maancham marked this conversation as resolved.
Show resolved Hide resolved

- name: List contents of root directory
run: ls -la

- uses: ryand56/r2-upload-action@latest
with:
r2-account-id: ${{ secrets.R2_ACCOUNT_ID }}
r2-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_CF }}
r2-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_CF }}
r2-bucket: ${{ secrets.R2_BUCKET }}
source-dir: ${{ steps.build-binary.outputs.binary-directory }}
destination-dir: ./pre-releases/axelard/
9 changes: 9 additions & 0 deletions .github/workflows/build-docker-image-and-binaries.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,15 @@ jobs:
S3_PATH: s3://axelar-releases/axelard/${{ github.event.inputs.tag }}
run: |
aws s3 cp ./bin ${S3_PATH}/ --recursive

- uses: ryand56/r2-upload-action@latest
maancham marked this conversation as resolved.
Show resolved Hide resolved
with:
r2-account-id: ${{ secrets.R2_ACCOUNT_ID }}
r2-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_CF }}
r2-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_CF }}
r2-bucket: ${{ secrets.R2_BUCKET }}
source-dir: ./bin
destination-dir: ./releases/axelard/

release-docker:

Expand Down
Loading