Skip to content

Commit

Permalink
Fix release ci (#1526)
Browse files Browse the repository at this point in the history
* Fix release CI
* Added 1.11 upgrade handler
* Update Dockerfile
  • Loading branch information
Cashmaney authored Aug 29, 2023
1 parent 1fe954a commit b6dad47
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 72 deletions.
63 changes: 4 additions & 59 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
fail-fast: false
matrix:
db_backend: [rocksdb, goleveldb]
db_backend: [goleveldb]
runs-on: ubuntu-20.04
env: # Or as an environment variable
SPID: ${{ secrets.SPID_TESTNET }}
Expand All @@ -38,10 +38,6 @@ jobs:
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\/v/}
- name: Sets env vars for rocksdb
if: ${{ matrix.db_backend == 'rocksdb' }}
run: |
echo "DOCKER_CGO_LDFLAGS=-L/usr/lib/x86_64-linux-gnu/ -lrocksdb -lstdc++ -llz4 -lm -lz -lbz2 -lsnappy" >> $GITHUB_ENV
- name: Build .deb Package Image
uses: docker/build-push-action@v4
with:
Expand Down Expand Up @@ -74,7 +70,7 @@ jobs:
strategy:
fail-fast: false
matrix:
db_backend: [goleveldb, rocksdb]
db_backend: [goleveldb]
env: # Or as an environment variable
SPID: ${{ secrets.SPID_MAINNET }}
API_KEY: ${{ secrets.API_KEY_MAINNET }}
Expand Down Expand Up @@ -220,53 +216,10 @@ jobs:
docker run -e VERSION=${{ steps.get_version.outputs.VERSION }} -v $GITHUB_WORKSPACE/build:/build check_hw_tool_build
cp build/check_hw_${{ steps.get_version.outputs.VERSION }}.tar.gz check_hw_${{ steps.get_version.outputs.VERSION }}.tar.gz
# 1. Untar the archive
tar -xzf check_hw_${{ steps.get_version.outputs.VERSION }}.tar.gz
# 2. Rename the files
mv check_hw check_hw_testnet
mv check_hw_enclave.so check_hw_testnet_enclave.so
# 3. Retar the renamed files
tar -czf check_hw_${{ steps.get_version.outputs.VERSION }}_testnet.tar.gz check_hw_testnet check_hw_testnet_enclave.so
- uses: actions/upload-artifact@v3
with:
name: check_hw_${{ steps.get_version.outputs.VERSION }}_testnet.tar.gz
path: check_hw_${{ steps.get_version.outputs.VERSION }}_testnet.tar.gz

# check-hw-tool-mainnet:
# runs-on: ubuntu-20.04
# steps:
# - uses: actions/checkout@v3
# with:
# submodules: recursive
# - name: Get the version
# id: get_version
# run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\/v/}
# - name: Build check-hw-tool image
# uses: docker/build-push-action@v4
# with:
# file: deployment/dockerfiles/Dockerfile
# context: .
# load: true
# tags: check_hw_tool_build
# secrets: |
# API_KEY=${{ secrets.API_KEY_MAINNET }}
# SPID=${{ secrets.SPID_MAINNET }}
# build-args: |
# BUILD_VERSION=${{ steps.get_version.outputs.VERSION }}
# SGX_MODE=HW
# FEATURES=production
# target: compile-check-hw-tool
# - name: Run check-hw-tool image
# run: |
# docker run -e VERSION=${{ steps.get_version.outputs.VERSION }} -v $GITHUB_WORKSPACE/build:/build check_hw_tool_build
# cp build/check_hw_${{ steps.get_version.outputs.VERSION }}.tar.gz check_hw_${{ steps.get_version.outputs.VERSION }}.tar.gz
# - uses: actions/upload-artifact@v3
# with:
# name: check_hw_${{ steps.get_version.outputs.VERSION }}_mainnet.tar.gz
# path: check_hw_${{ steps.get_version.outputs.VERSION }}_mainnet.tar.gz
name: check_hw_${{ steps.get_version.outputs.VERSION }}.tar.gz
path: check_hw_${{ steps.get_version.outputs.VERSION }}.tar.gz

publish-localsecret:
runs-on: ubuntu-20.04
Expand Down Expand Up @@ -352,15 +305,9 @@ jobs:
- uses: actions/download-artifact@v3
with:
name: secretnetwork_${{ steps.get_version.outputs.VERSION }}_mainnet_goleveldb_amd64.deb
- uses: actions/download-artifact@v3
with:
name: secretnetwork_${{ steps.get_version.outputs.VERSION }}_mainnet_rocksdb_amd64.deb
- uses: actions/download-artifact@v3
with:
name: secretnetwork_${{ steps.get_version.outputs.VERSION }}_testnet_goleveldb_amd64.deb
- uses: actions/download-artifact@v3
with:
name: secretnetwork_${{ steps.get_version.outputs.VERSION }}_testnet_rocksdb_amd64.deb
- uses: actions/download-artifact@v3
with:
name: check_hw_${{ steps.get_version.outputs.VERSION }}.tar.gz
Expand All @@ -373,9 +320,7 @@ jobs:
prerelease: true
files: |
secretnetwork_${{ steps.get_version.outputs.VERSION }}_mainnet_goleveldb_amd64.deb
secretnetwork_${{ steps.get_version.outputs.VERSION }}_mainnet_rocksdb_amd64.deb
secretnetwork_${{ steps.get_version.outputs.VERSION }}_testnet_goleveldb_amd64.deb
secretnetwork_${{ steps.get_version.outputs.VERSION }}_testnet_rocksdb_amd64.deb
secretcli-macOS
secretcli-Windows
secretcli-Linux
Expand Down
2 changes: 2 additions & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import (
"github.com/scrtlabs/SecretNetwork/app/keepers"
"github.com/scrtlabs/SecretNetwork/app/upgrades"
v1_10 "github.com/scrtlabs/SecretNetwork/app/upgrades/v1.10"
v1_11 "github.com/scrtlabs/SecretNetwork/app/upgrades/v1.11"
v1_3 "github.com/scrtlabs/SecretNetwork/app/upgrades/v1.3"
v1_4 "github.com/scrtlabs/SecretNetwork/app/upgrades/v1.4"
v1_5 "github.com/scrtlabs/SecretNetwork/app/upgrades/v1.5"
Expand Down Expand Up @@ -103,6 +104,7 @@ var (
v1_8.Upgrade,
v1_9.Upgrade,
v1_10.Upgrade,
v1_11.Upgrade,
}
)

Expand Down
10 changes: 1 addition & 9 deletions app/upgrades/v1.10/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,14 @@ import (
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
"github.com/scrtlabs/SecretNetwork/app/keepers"
"github.com/scrtlabs/SecretNetwork/app/upgrades"
ibchookstypes "github.com/scrtlabs/SecretNetwork/x/ibc-hooks/types"
)

const upgradeName = "v1.10"

var Upgrade = upgrades.Upgrade{
UpgradeName: upgradeName,
CreateUpgradeHandler: createUpgradeHandler,
StoreUpgrades: store.StoreUpgrades{
Added: []string{
ibchookstypes.StoreKey,
},
},
StoreUpgrades: store.StoreUpgrades{},
}

func createUpgradeHandler(mm *module.Manager, _ *keepers.SecretAppKeepers, configurator module.Configurator,
Expand All @@ -34,9 +29,6 @@ func createUpgradeHandler(mm *module.Manager, _ *keepers.SecretAppKeepers, confi
ctx.Logger().Info(`| |__| | | | |__| | | \ \ / ____ \| |__| | |____ `)
ctx.Logger().Info(` \____/|_| \_____|_| \_\/_/ \_\_____/|______|`)

// WASM Hooks doesn't require any initialization code:
// https://github.com/osmosis-labs/osmosis/blob/8b4c62a26/app/upgrades/v14/upgrades.go#L12-L21

ctx.Logger().Info(fmt.Sprintf("Running module migrations for %s...", upgradeName))
return mm.RunMigrations(ctx, configurator, vm)
}
Expand Down
43 changes: 43 additions & 0 deletions app/upgrades/v1.11/upgrade.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package v1_11

import (
"fmt"

store "github.com/cosmos/cosmos-sdk/store/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
"github.com/scrtlabs/SecretNetwork/app/keepers"
"github.com/scrtlabs/SecretNetwork/app/upgrades"
ibchookstypes "github.com/scrtlabs/SecretNetwork/x/ibc-hooks/types"
)

const upgradeName = "v1.11"

var Upgrade = upgrades.Upgrade{
UpgradeName: upgradeName,
CreateUpgradeHandler: createUpgradeHandler,
StoreUpgrades: store.StoreUpgrades{
Added: []string{
ibchookstypes.StoreKey,
},
},
}

func createUpgradeHandler(mm *module.Manager, _ *keepers.SecretAppKeepers, configurator module.Configurator,
) upgradetypes.UpgradeHandler {
return func(ctx sdk.Context, _ upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) {
ctx.Logger().Info(` _ _ _____ _____ _____ _____ ______ `)
ctx.Logger().Info(`| | | | __ \ / ____| __ \ /\ | __ \| ____|`)
ctx.Logger().Info(`| | | | |__) | | __| |__) | / \ | | | | |__ `)
ctx.Logger().Info(`| | | | ___/| | |_ | _ / / /\ \ | | | | __| `)
ctx.Logger().Info(`| |__| | | | |__| | | \ \ / ____ \| |__| | |____ `)
ctx.Logger().Info(` \____/|_| \_____|_| \_\/_/ \_\_____/|______|`)

// WASM Hooks doesn't require any initialization code:
// https://github.com/osmosis-labs/osmosis/blob/8b4c62a26/app/upgrades/v14/upgrades.go#L12-L21

ctx.Logger().Info(fmt.Sprintf("Running module migrations for %s...", upgradeName))
return mm.RunMigrations(ctx, configurator, vm)
}
}
4 changes: 2 additions & 2 deletions check-hw/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions deployment/dockerfiles/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ ENV FEATURES=${FEATURES}
ENV FEATURES_U=${FEATURES_U}
ENV MITIGATION_CVE_2020_0551=${MITIGATION_CVE_2020_0551}

RUN git clone --branch main --depth 1 https://github.com/scrtlabs/tm-secret-enclave.git
RUN git clone --branch v1.11.3 --depth 1 https://github.com/scrtlabs/tm-secret-enclave.git

WORKDIR tm-secret-enclave

Expand All @@ -80,7 +80,7 @@ RUN git submodule update --remote
RUN rustup component add rust-src
RUN cargo install xargo --version 0.3.25

RUN . /opt/sgxsdk/environment && env && LD_LIBRARY_PATH=/opt/sgxsdk/lib64 FEATURES=${FEATURES} MITIGATION_CVE_2020_0551=${MITIGATION_CVE_2020_0551} SGX_MODE=${SGX_MODE} FEATURES_U="$(echo \"${FEATURES_U}\" | perl -pe 's/go-tests|debug-print//g')" make build
RUN . /opt/sgxsdk/environment && env && LD_LIBRARY_PATH=/opt/sgxsdk/lib64 FEATURES="$(echo \"${FEATURES}\" | perl -pe 's/go-tests|debug-print//g')" MITIGATION_CVE_2020_0551=${MITIGATION_CVE_2020_0551} SGX_MODE=${SGX_MODE} FEATURES_U="$(echo \"${FEATURES_U}\" | perl -pe 's/go-tests|debug-print//g')" make build

# ***************** COMPILE SECRETD ************** #
FROM $SCRT_BASE_IMAGE_ENCLAVE AS compile-secretd
Expand Down

0 comments on commit b6dad47

Please sign in to comment.