Sovereign chain simulator adaptations #123
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: Publish Docker image | |
on: | |
release: | |
types: [published] | |
pull_request: | |
jobs: | |
push_to_registry: | |
name: Push Docker image to Docker Hub | |
runs-on: ubuntu-22.04 | |
permissions: | |
packages: write | |
contents: read | |
attestations: write | |
steps: | |
- name: Set up Go 1.x | |
uses: actions/setup-go@v5 | |
with: | |
go-version: 1.20.7 | |
id: go | |
- name: Checkout mx-chain-go | |
uses: actions/checkout@v4 | |
with: | |
repository: 'multiversx/mx-chain-go' | |
ref: 'feat/chain-go-sdk' | |
path: 'mx-chain-go' | |
- name: Check out the repo | |
uses: actions/checkout@v4 | |
with: | |
path: 'mx-chain-simulator-go' | |
- name: Run go mod tidy | |
run: go mod tidy | |
working-directory: mx-chain-simulator-go | |
- name: Get dependencies | |
run: | | |
cd mx-chain-simulator-go | |
go get -v -t -d ./... | |
if [ -f Gopkg.toml ]; then | |
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh | |
dep ensure | |
fi | |
- name: Build and run chain simulator to fetch configs | |
run: | | |
cd mx-chain-simulator-go/cmd/chainsimulator | |
go build | |
./chainsimulator --fetch-configs-and-close | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Log in to Docker Hub | |
if: ${{ github.event_name == 'release' && github.event.action == 'published' }} | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: multiversx/sovereign-chainsimulator | |
- name: Build and push Docker image | |
id: push | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
file: ./mx-chain-simulator-go/Dockerfile-sovereign | |
platforms: linux/amd64,linux/arm64 | |
push: ${{ github.event_name == 'release' && github.event.action == 'published' }} | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |