|
| 1 | +name: build-evmos |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - '**' |
| 7 | + tags: |
| 8 | + - 'v*.*.*' |
| 9 | + pull_request: |
| 10 | + branches: |
| 11 | + - 'main' |
| 12 | + workflow_dispatch: |
| 13 | + |
| 14 | +env: |
| 15 | + REGISTRY: ghcr.io |
| 16 | + IMAGE_NAME: celestiaorg/evmos |
| 17 | + TAG_PREFIX: optimint- |
| 18 | + |
| 19 | +jobs: |
| 20 | + build: |
| 21 | + runs-on: "ubuntu-latest" |
| 22 | + permissions: |
| 23 | + contents: write |
| 24 | + packages: write |
| 25 | + steps: |
| 26 | + - name: "Checkout source code" |
| 27 | + uses: "actions/checkout@v2" |
| 28 | + - name: Set up Go |
| 29 | + uses: actions/setup-go@v2 |
| 30 | + with: |
| 31 | + go-version: 1.17 |
| 32 | + - name: up a level |
| 33 | + run: cd .. && pwd |
| 34 | + - name: Clone evmos repo |
| 35 | + uses: actions/checkout@v2 |
| 36 | + with: |
| 37 | + repository: jbowen93/evmos |
| 38 | + path: evmos |
| 39 | + - name: Clone ethermint repo |
| 40 | + uses: actions/checkout@v2 |
| 41 | + with: |
| 42 | + repository: celestiaorg/ethermint |
| 43 | + path: ethermint |
| 44 | + ref: v0.11.0+0.1.0 |
| 45 | + - name: Move Stuff and Tidy |
| 46 | + run: | |
| 47 | + ls |
| 48 | + mv evmos .. |
| 49 | + mv ethermint .. |
| 50 | + cd .. |
| 51 | + cp -R optimint ethermint |
| 52 | + cd ethermint |
| 53 | + rm -rf .git |
| 54 | + go mod edit -replace=github.com/celestiaorg/optimint=./optimint |
| 55 | + go mod tidy -compat=1.17 -e |
| 56 | + cd .. |
| 57 | + cp -R ethermint evmos |
| 58 | + cd evmos |
| 59 | + go mod edit -replace=github.com/tharsis/ethermint=./ethermint |
| 60 | + go mod tidy -compat=1.17 -e |
| 61 | + - name: Docker meta |
| 62 | + id: meta |
| 63 | + uses: docker/metadata-action@v3 |
| 64 | + with: |
| 65 | + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} |
| 66 | + tags: | |
| 67 | + type=sha,prefix=${{ env.TAG_PREFIX }} |
| 68 | + - name: Set up QEMU |
| 69 | + uses: docker/setup-qemu-action@v1 |
| 70 | + - name: Set up Docker Buildx |
| 71 | + uses: docker/setup-buildx-action@v1 |
| 72 | + - name: Login to GHCR |
| 73 | + uses: docker/login-action@v1 |
| 74 | + with: |
| 75 | + registry: ghcr.io |
| 76 | + username: ${{ github.repository_owner }} |
| 77 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 78 | + - name: Build and push |
| 79 | + uses: docker/build-push-action@v2 |
| 80 | + with: |
| 81 | + context: ../evmos |
| 82 | + platforms: linux/amd64, linux/arm64 |
| 83 | + push: true |
| 84 | + tags: ${{ steps.meta.outputs.tags }} |
| 85 | + file: ../evmos/docker/Dockerfile |
0 commit comments