-
Notifications
You must be signed in to change notification settings - Fork 121
62 lines (57 loc) · 2.08 KB
/
build-binaries-and-push-to-r2.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Upload core binary to Cloudflare R2 bucket
on:
push:
branches:
- main
workflow_dispatch:
inputs:
branch:
description: Github branch or tag to checkout for compilation
required: true
default: main
type: string
jobs:
build-and-upload:
name: Build binary and push to R2
runs-on: ubuntu-22.04
permissions:
contents: write
packages: write
id-token: write
steps:
- name: Determine checkout ref
id: get-checkout-ref
run: |
if [ "${{ github.event_name }}" == "push" ]; then
ref="main"
else
ref="${{ inputs.branch }}"
fi
echo "ref=$ref" >> $GITHUB_OUTPUT
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: "0"
path: axelar-core
submodules: recursive
ref: ${{ steps.get-checkout-ref.outputs.ref }}
- name: Build axelard binary with version and commit hash
id: build-binary
run: |
cd axelar-core
make build
semver=$(git describe --tags)
commit_hash=$(git rev-parse --short HEAD)
echo "Semantic Version of current binary: $semver"
cd ..
mkdir -p ./$commit_hash/
sudo mv axelar-core/bin/axelard ./$commit_hash/axelard-linux-amd64-$semver
echo "binary-directory=./$commit_hash" >> $GITHUB_OUTPUT
- uses: ryand56/[email protected]
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/