Skip to content

Commit

Permalink
Refactor binaries workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
jcortejoso committed Oct 26, 2023
1 parent 2c10dba commit ab07413
Showing 1 changed file with 40 additions and 10 deletions.
50 changes: 40 additions & 10 deletions .github/workflows/build-sign-binaries.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,26 @@ on:
push:
branches:
- master
- 'release/[0-9]+.[0-9]+'
- 'release/[0-9]+.[0-9]+.x'
workflow_dispatch:

jobs:
Build-Container-Blockchain-Binaries:
uses: celo-org/reusable-workflows/.github/workflows/container-cicd.yaml@v1.8
build-container-blockchain-binaries:
uses: celo-org/reusable-workflows/.github/workflows/container-cicd.yaml@1e4de01c8a4c8271b1a9599c72894684386d63cd
with:
workload-id-provider: 'projects/1094498259535/locations/global/workloadIdentityPools/gh-celo-blockchain/providers/github-by-repos'
service-account: '[email protected]'
artifact-registry: us-west1-docker.pkg.dev/devopsre/celo-blockchain-public/geth-xgo-builder
tag: latest
platforms: linux/amd64
context: .
file: Dockerfile.binaries
trivy: true

Upload-Cloud-Storage:
upload-cloud-storage:
runs-on: ubuntu-latest
needs:
- Build-Container-Blockchain-Binaries
- build-container-blockchain-binaries
permissions:
contents: 'read'
id-token: 'write'
Expand All @@ -32,10 +33,10 @@ jobs:
BRANCH_NAME: ${{ github.ref_name }}
REPO_NAME: ${{ github.repository }}
COMMIT_SHA: ${{ github.sha }}
steps:

steps:
- name: 'Checkout'
uses: actions/checkout@v3
uses: actions/checkout@v4

- id: 'auth-gcp-master'
name: 'Authenticate to Google Cloud'
Expand All @@ -58,14 +59,43 @@ jobs:
- name: 'Go Run all-tools'
run: |
docker run --rm -v $(pwd)/build/bin:/build -v $(pwd)/build/archives:/archives -v $(pwd):/go/src/github.com/celo-org/celo-blockchain --entrypoint /bin/sh --env BUILD_TARGETS=$_BUILD_TARGETS --env TAG_NAME=$TAG_NAME --env BRANCH_NAME=$BRANCH_NAME --env REPO_NAME=$REPO_NAME --env COMMIT_SHA=$COMMIT_SHA --env COMMIT_TIMESTAMP=${{ env.COMMIT_TIMESTAMP }} --env CLOUDBUILD=True --env CI=True us-west1-docker.pkg.dev/devopsre/celo-blockchain-public/geth-xgo-builder:$COMMIT_SHA -c "go run build/ci.go xgo --alltools -- -targets=$BUILD_TARGETS -v -dest /build"
docker run --rm \
\
-v $(pwd)/build/bin:/build \
-v $(pwd)/build/archives:/archives \
-v $(pwd):/go/src/github.com/celo-org/celo-blockchain \
--env BUILD_TARGETS=$_BUILD_TARGETS \
--env TAG_NAME=$TAG_NAME \
--env BRANCH_NAME=$BRANCH_NAME \
--env REPO_NAME=$REPO_NAME \
--env COMMIT_SHA=$COMMIT_SHA \
--env COMMIT_TIMESTAMP=${{ env.COMMIT_TIMESTAMP }} \
--env CLOUDBUILD=True \
--env CI=True \
--entrypoint /bin/sh \
us-west1-docker.pkg.dev/devopsre/celo-blockchain-public/geth-xgo-builder:$COMMIT_SHA \
-c "go run build/ci.go xgo --alltools -- -targets=$BUILD_TARGETS -v -dest /build"
- name: 'Go Run xgo-archive'
run: |
docker run --rm -v $(pwd)/build/bin:/build -v $(pwd)/build/archives:/archives -v $(pwd):/go/src/github.com/celo-org/celo-blockchain --entrypoint /bin/sh --env BUILD_TARGETS=$_BUILD_TARGETS --env TAG_NAME=$TAG_NAME --env BRANCH_NAME=$BRANCH_NAME --env REPO_NAME=$REPO_NAME --env COMMIT_SHA=$COMMIT_SHA --env COMMIT_TIMESTAMP=${{ env.COMMIT_TIMESTAMP }} --env CLOUDBUILD=True --env CI=True us-west1-docker.pkg.dev/devopsre/celo-blockchain-public/geth-xgo-builder:$COMMIT_SHA -c "go run build/ci.go xgo-archive -targets=$BUILD_TARGETS -in /build -out /archives"
docker run --rm \
-v $(pwd)/build/bin:/build \
-v $(pwd)/build/archives:/archives \
-v $(pwd):/go/src/github.com/celo-org/celo-blockchain \
--env BUILD_TARGETS=$_BUILD_TARGETS \
--env TAG_NAME=$TAG_NAME \
--env BRANCH_NAME=$BRANCH_NAME \
--env REPO_NAME=$REPO_NAME \
--env COMMIT_SHA=$COMMIT_SHA \
--env COMMIT_TIMESTAMP=${{ env.COMMIT_TIMESTAMP }} \
--env CLOUDBUILD=True \
--env CI=True \
--entrypoint /bin/sh \
us-west1-docker.pkg.dev/devopsre/celo-blockchain-public/geth-xgo-builder:$COMMIT_SHA \
-c "go run build/ci.go xgo-archive -targets=$BUILD_TARGETS -in /build -out /archives"
- name: 'Upload to storage bucket'
uses: 'google-github-actions/upload-cloud-storage@v1'
uses: google-github-actions/upload-cloud-storage@v1
with:
path: './build/archives'
destination: celo-blockchain-binaries/binaries/${{ env.BRANCH_NAME }}
Expand Down

0 comments on commit ab07413

Please sign in to comment.