Build nesachain #32
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
name: STG Deploy | |
env: | |
ENV: stg | |
PROJECT: nesa | |
APPLICATION: docker | |
SHARED_REPO_NAME: nesaorg/devops-shared-library | |
SHARED_REPO_NAME_SSH: [email protected]:nesaorg/devops-shared-library.git | |
SHARED_REPO_BRANCH: main | |
REPO_NESACHAIN_NAME: nesaorg/nesachain | |
REPO_NESACHAIN_BRANCH: main | |
REPO_NESACHAIN_DIR: nesachain | |
GITHUB_TOKEN: ${{ secrets.READ_GITHUB_TOKEN }} | |
GCP_PROJECT_ID: "phonic-scheme-417316" | |
GCP_KEY: ${{ secrets.GCP_KEY_STG }} | |
GCP_REGION: us-central1 | |
DOCKER_FILE: ./Dockerfile | |
BRANCH_TO_BUILD_BY_DISPATCH: main | |
on: | |
workflow_dispatch: | |
repository_dispatch: | |
types: [trigger-build] | |
push: | |
branches: | |
- main | |
jobs: | |
buildNesaChain: | |
name: 'Build/NesaChain' | |
runs-on: ubuntu-22.04 | |
defaults: | |
run: | |
shell: bash | |
# container: | |
# image: golang:bookworm | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ env.BRANCH_TO_BUILD_BY_DISPATCH }} | |
- name: Clone NesaChain repo | |
uses: actions/checkout@v4 | |
with: | |
repository: ${{ env.REPO_NESACHAIN_NAME }} | |
ref: ${{ env.REPO_NESACHAIN_BRANCH }} | |
token: ${{ env.GITHUB_TOKEN }} | |
path: ./${{ env.REPO_NESACHAIN_DIR }} | |
- uses: ./.github/actions/get_terraform_shared_library_aws | |
- run: sudo apt update && sudo apt-get install make git -y | |
- uses: actions/setup-go@v5 | |
# - run: | | |
# set -eux | |
# export ARCH=amd64 | |
# WASM_VERSION=$(go list -m all | grep github.com/CosmWasm/wasmvm || true) | |
# if [ ! -z "${WASM_VERSION}" ]; | |
# then | |
# WASMVM_REPO=$(echo $WASM_VERSION | awk '{print $1}') | |
# WASMVM_VERS=$(echo $WASM_VERSION | awk '{print $2}') | |
# wget -O /lib/libwasmvm_muslc.a https://${WASMVM_REPO}/releases/download/${WASMVM_VERS}/libwasmvm_muslc.$(uname -m).a | |
# fi | |
# go mod download | |
# working-directory: ${{ env.REPO_NESACHAIN_DIR }} | |
# env: | |
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- run: | | |
GOARCH=amd64 make build | |
ls -l build/ | |
ls -l cmd/ | |
# ls -l ./code/build/nesad | |
# file ./code/build/nesad | |
# echo "Ensuring binary is statically linked ..." | |
# (file ./code/build/nesad | grep "statically linked") | |
working-directory: ${{ env.REPO_NESACHAIN_DIR }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# - name: Build | |
# uses: goreleaser/goreleaser-action@v5 | |
# with: | |
# version: latest | |
# args: build | |
# working-directory: ${{ env.REPO_NESACHAIN_DIR }} | |
# env: | |
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# - run: ls -lA | |
# - run: ls -lA ./${{ env.REPO_NESACHAIN_DIR }} | |
# | |
# | |
# | |
# | |
# | |
# - uses: actions/upload-artifact@v2 | |
# with: | |
# name: files.tar | |
# path: | | |
# files.tar | |
# | |
# | |
# | |
# - name: Build | |
# uses: goreleaser/goreleaser-action@v5 | |
# with: | |
# version: latest | |
# args: build --skip-validate | |
# | |
# - name: Release | |
# uses: goreleaser/goreleaser-action@v5 | |
# if: startsWith(github.ref, 'refs/tags/') | |
# with: | |
# version: latest | |
# args: release --skip-validate --clean | |
# env: | |
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# build: | |
# name: 'App/Build' | |
# runs-on: ubuntu-22.04 | |
# | |
# defaults: | |
# run: | |
# shell: bash | |
# | |
# steps: | |
## - uses: jlumbroso/free-disk-space@main | |
## with: | |
## tool-cache: true | |
## android: true | |
## dotnet: true | |
## haskell: true | |
## large-packages: true | |
## swap-storage: true | |
# - uses: actions/checkout@v4 | |
# with: | |
# ref: ${{ env.BRANCH_TO_BUILD_BY_DISPATCH }} | |
# - name: Clone NesaChain repo | |
# uses: actions/checkout@v4 | |
# with: | |
# repository: ${{ env.REPO_NESACHAIN_NAME }} | |
# ref: ${{ env.REPO_NESACHAIN_BRANCH }} | |
# token: ${{ env.GITHUB_TOKEN }} | |
# path: ./${{ env.REPO_NESACHAIN_DIR }} | |
# - run: ls -lA | |
# - run: ls -lA ./${{ env.REPO_NESACHAIN_DIR }} | |
# - uses: ./.github/actions/get_terraform_shared_library_aws | |
# | |
# | |
# - name: Set up the latest Go | |
# uses: actions/setup-go@v5 | |
# | |
# - name: Install make | |
# run: sudo apt update && sudo apt-get install make | |
# | |
# - name: Get dependencies | |
# run: go mod download | |
# working-directory: ${{ env.REPO_NESACHAIN_DIR }} | |
# | |
# - name: Get dependencies | |
# run: make proto-gen | |
# working-directory: ${{ env.REPO_NESACHAIN_DIR }} | |
# | |
# | |
## - name: Build for AMD64 | |
## env: | |
## GOOS: linux | |
## GOARCH: amd64 | |
## run: go build -v -o ./nesa-amd64 | |
## working-directory: ${{ env.REPO_NESACHAIN_DIR }} | |
## | |
## - name: Build for ARM64 | |
## env: | |
## GOOS: linux | |
## GOARCH: arm64 | |
## run: go build -v -o ./nesa-arm64 | |
## working-directory: ${{ env.REPO_NESACHAIN_DIR }} | |
## | |
## - name: Copy binaries to root project folder | |
## run: | | |
## cp ./nesa-amd64 ../ | |
## cp ./nesa-arm64 ../ | |
## working-directory: ${{ env.REPO_NESACHAIN_DIR }} | |
# - run: ls -lA | |
## - uses: ./shared/actions/all/gitCommitHash | |
## - uses: ./shared/actions/all/gcpAuth | |
## - uses: ./shared/actions/all/gcpAuthDocker | |
## - uses: ./shared/actions/all/dockerBuildPush | |
## env: | |
## IMAGE_NAME: ${{ env.PROJECT }}-${{ env.APPLICATION }} |