Skip to content

Commit

Permalink
Fix build for ubuntu-20.04
Browse files Browse the repository at this point in the history
  • Loading branch information
iKapitonau committed Nov 1, 2024
1 parent fdd14e5 commit 2fc9d1e
Show file tree
Hide file tree
Showing 3 changed files with 435 additions and 10 deletions.
74 changes: 66 additions & 8 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ jobs:
fail-fast: false
matrix:
db_backend: [goleveldb]
os: [ubuntu-22.04, ubuntu-20.04]
runs-on: ${{matrix.os}}
runs-on: ubuntu-22.04
env: # Or as an environment variable
SPID: ${{ secrets.SPID_TESTNET }}
API_KEY: ${{ secrets.API_KEY_TESTNET }}
Expand Down Expand Up @@ -60,11 +59,65 @@ jobs:
- name: Run .deb Package Image
run: |
docker run -e VERSION=${{ steps.get_version.outputs.VERSION }} -v $GITHUB_WORKSPACE/build:/build deb_build
cp build/secretnetwork_${{ steps.get_version.outputs.VERSION }}_amd64.deb secretnetwork_${{ steps.get_version.outputs.VERSION }}_testnet_${{ matrix.db_backend }}_amd64_${{ matrix.os }}.deb
cp build/secretnetwork_${{ steps.get_version.outputs.VERSION }}_amd64.deb secretnetwork_${{ steps.get_version.outputs.VERSION }}_testnet_${{ matrix.db_backend }}_amd64_ubuntu-22.04.deb
- uses: actions/upload-artifact@v3
with:
name: secretnetwork_${{ steps.get_version.outputs.VERSION }}_testnet_${{ matrix.db_backend }}_amd64_ubuntu-22.04.deb
path: secretnetwork_${{ steps.get_version.outputs.VERSION }}_testnet_${{ matrix.db_backend }}_amd64_ubuntu-22.04.deb

build-deb-testnet-20.04:
strategy:
fail-fast: false
matrix:
db_backend: [goleveldb]
runs-on: ubuntu-20.04
env: # Or as an environment variable
SPID: ${{ secrets.SPID_TESTNET }}
API_KEY: ${{ secrets.API_KEY_TESTNET }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Declare Commit Variables
id: vars
shell: bash
run: |
echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
- name: Cache build artifacts
uses: actions/cache@v4
with:
path: ~/.cache/sccache
key: ${{ runner.os }}-sccache
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\/v/}
- name: Build .deb Package Image
uses: docker/build-push-action@v4
with:
file: deployment/dockerfiles/Dockerfile.2004
context: .
load: true
tags: deb_build
secrets: |
API_KEY=${{ secrets.API_KEY_TESTNET }}
SPID=${{ secrets.SPID_TESTNET }}
build-args: |
SECRET_NODE_TYPE=NODE
DB_BACKEND=${{ matrix.db_backend }}
CGO_LDFLAGS=${{ env.DOCKER_CGO_LDFLAGS }}
BUILD_VERSION=${{ steps.get_version.outputs.VERSION }}
SGX_MODE=HW
FEATURES="verify-validator-whitelist,light-client-validation,random"
target: build-deb
- name: Run .deb Package Image
run: |
docker run -e VERSION=${{ steps.get_version.outputs.VERSION }} -v $GITHUB_WORKSPACE/build:/build deb_build
cp build/secretnetwork_${{ steps.get_version.outputs.VERSION }}_amd64.deb secretnetwork_${{ steps.get_version.outputs.VERSION }}_testnet_${{ matrix.db_backend }}_amd64_ubuntu-20.04.deb
- uses: actions/upload-artifact@v3
with:
name: secretnetwork_${{ steps.get_version.outputs.VERSION }}_testnet_${{ matrix.db_backend }}_amd64_${{ matrix.os }}.deb
path: secretnetwork_${{ steps.get_version.outputs.VERSION }}_testnet_${{ matrix.db_backend }}_amd64_${{ matrix.os }}.deb
name: secretnetwork_${{ steps.get_version.outputs.VERSION }}_testnet_${{ matrix.db_backend }}_amd64_ubuntu-20.04.deb
path: secretnetwork_${{ steps.get_version.outputs.VERSION }}_testnet_${{ matrix.db_backend }}_amd64_ubuntu-20.04.deb

build-deb-mainnet:
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -147,7 +200,7 @@ jobs:
runs-on: ${{matrix.os}}
strategy:
matrix:
os: [ubuntu-22.04, windows-latest, macos-13]
os: [ubuntu-22.04, windows-latest, macos-13, ubuntu-20.04]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
Expand Down Expand Up @@ -281,6 +334,7 @@ jobs:
needs: [
native-build-cli,
build-deb-testnet,
build-deb-testnet-20.04,
# build-deb-mainnet,
MacOS-ARM64-CLI,
# check-hw-tool,
Expand Down Expand Up @@ -309,7 +363,10 @@ jobs:
# name: secretnetwork_${{ steps.get_version.outputs.VERSION }}_mainnet_goleveldb_amd64.deb
- uses: actions/download-artifact@v3
with:
name: secretnetwork_${{ steps.get_version.outputs.VERSION }}_testnet_goleveldb_amd64.deb
name: secretnetwork_${{ steps.get_version.outputs.VERSION }}_testnet_goleveldb_amd64_ubuntu-20.04.deb
- uses: actions/download-artifact@v3
with:
name: secretnetwork_${{ steps.get_version.outputs.VERSION }}_testnet_goleveldb_amd64_ubuntu-22.04.deb
# - uses: actions/download-artifact@v3
# with:
# name: check_hw_${{ steps.get_version.outputs.VERSION }}.tar.gz
Expand All @@ -321,7 +378,8 @@ jobs:
with:
prerelease: true
files: |
secretnetwork_${{ steps.get_version.outputs.VERSION }}_testnet_goleveldb_amd64.deb
secretnetwork_${{ steps.get_version.outputs.VERSION }}_testnet_goleveldb_amd64_ubuntu-20.04.deb
secretnetwork_${{ steps.get_version.outputs.VERSION }}_testnet_goleveldb_amd64_ubuntu-22.04.deb
secretcli-macOS
secretcli-Windows
secretcli-Linux
Expand Down
4 changes: 2 additions & 2 deletions deployment/dockerfiles/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ WORKDIR /go/src/github.com/scrtlabs/SecretNetwork/
# ***************** COMPILE ENCLAVE ************** #
FROM prepare-compile-enclave AS compile-enclave

ARG BUILD_VERSION="v1.15.0"
ARG BUILD_VERSION="v0.0.0"
ARG SGX_MODE=SW
ARG FEATURES
ARG FEATURES_U
Expand Down Expand Up @@ -58,7 +58,7 @@ RUN . /opt/sgxsdk/environment && env \

FROM prepare-compile-enclave AS compile-tendermint-enclave

ARG BUILD_VERSION="v1.15.0"
ARG BUILD_VERSION="v0.0.0"
ARG SGX_MODE=SW
ARG FEATURES
ARG FEATURES_U
Expand Down
Loading

0 comments on commit 2fc9d1e

Please sign in to comment.