diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8397348098c..f1da879c762 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,6 +6,10 @@ on: - 'v[0-9]+.[0-9]+.[0-9]+' # Push events to matching v*, i.e. v1.0.0, v20.15.10 - 'v[0-9]+.[0-9]+.[0-9]+-?[a-z0-9]+' # Push events to matching v*-[alpha/beta/rc], i.e. v3.0.0-alpha1, v3.0.0-beta1, v3.0.0-rc0 +env: + REGISTRY: ghcr.io + IMAGE_NAME: ibc-go-simd + jobs: goreleaser: runs-on: ubuntu-latest @@ -27,3 +31,24 @@ jobs: args: release --rm-dist env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Log in to the Container registry + uses: docker/login-action@49ed152c8eca782a232dede0303416e8f356c37b + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@69f6fc9d46f2f8bf0d5491e4aabe0bb8c6a4678a + with: + images: ${{ env.REGISTRY }}/cosmos/${{ env.IMAGE_NAME }} + + - name: Build and push Docker image + uses: docker/build-push-action@1cb9d22b932e4832bb29793b7777ec860fc1cde0 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000000..a193f54906e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,23 @@ +FROM golang:1.18 as builder + +ENV GOPATH="" +ENV GOMODULE="on" + +COPY go.mod . +COPY go.sum . + +RUN go mod download + +ADD testing testing +ADD modules modules +ADD LICENSE LICENSE + +COPY Makefile . + +RUN make build + +FROM ubuntu:20.04 + +COPY --from=builder /go/build/simd /bin/simd + +ENTRYPOINT ["simd"]