Skip to content

Implement CI/CD workflows for Initia binary builds #4

Implement CI/CD workflows for Initia binary builds

Implement CI/CD workflows for Initia binary builds #4

Workflow file for this run

name: CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
L1_NETWORK_NAME: testnet
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
platform:
- linux/amd64
- linux/arm64
- darwin/amd64
- darwin/arm64
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build
uses: docker/build-push-action@v4
with:
context: .
file: .github/workflows/Dockerfile
platforms: ${{ matrix.platform }}
load: true
tags: initia:${{ github.sha }}
- name: Export binary
run: |
platform=${{ matrix.platform }}
os=${platform%/*}
arch=${platform#*/}
container_id=$(docker create initia:${{ github.sha }})
docker cp $container_id:/app ./app
tar -czvf initia_${{ github.sha }}_${os^}_${arch}.tar.gz -C app .
docker rm $container_id
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v1
with:
project_id: ${{ secrets.GCP_PROJECT_ID }}
service_account_key: ${{ secrets.GCP_SA_KEY }}
export_default_credentials: true
- name: Upload to GCS
run: |
platform=${{ matrix.platform }}
os=${platform%/*}
arch=${platform#*/}
gsutil cp initia_${{ github.sha }}_${os^}_${arch}.tar.gz gs://your-bucket-name/networks/${{ env.L1_NETWORK_NAME }}/binaries/