-
Notifications
You must be signed in to change notification settings - Fork 1
198 lines (181 loc) · 5.44 KB
/
stg.yml
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
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: |
LINK_STATICALLY=true GOARCH=amd64 make proto-gen
LINK_STATICALLY=true GOARCH=amd64 make install
# 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 }}