Skip to content

Commit

Permalink
Merge branch 'master' of github.com:maticnetwork/bor into v0.2.12-can…
Browse files Browse the repository at this point in the history
…didate
  • Loading branch information
temaniarpit27 committed Dec 7, 2021
2 parents 488ea2b + b633382 commit a276c23
Show file tree
Hide file tree
Showing 63 changed files with 6,185 additions and 144 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Install Go
uses: actions/setup-go@v2.1.3
uses: actions/setup-go@v2
with:
go-version: 1.16.7
go-version: 1.17
- name: "Build binaries"
run: make all
- name: "Run tests"
Expand Down
26 changes: 0 additions & 26 deletions .github/workflows/dockerimage-latest.yml

This file was deleted.

25 changes: 0 additions & 25 deletions .github/workflows/dockerimage.yml

This file was deleted.

67 changes: 0 additions & 67 deletions .github/workflows/linuxpackage.yml

This file was deleted.

43 changes: 43 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Release

on:
push:
branches-ignore:
- '**'
tags:
- 'v*.*.*'
# to be used by fork patch-releases ^^
- 'v*.*.*-*'

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@master
with:
go-version: 1.17.x

- name: Prepare
id: prepare
run: |
TAG=${GITHUB_REF#refs/tags/}
echo ::set-output name=tag_name::${TAG}
- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- name: Run GoReleaser
run: |
make release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${{ steps.prepare.outputs.tag_name }}
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
DOCKER_USERNAME: ${{ secrets.DOCKERHUB }}
DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_KEY }}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,7 @@ profile.cov
/dashboard/assets/package-lock.json

**/yarn-error.log
./test
./bor-debug-*

dist
126 changes: 126 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
project_name: bor

release:
disable: false
draft: true
prerelease: auto

builds:
- id: darwin-amd64
main: ./cmd/geth
binary: bor
goos:
- darwin
goarch:
- amd64
env:
- CC=o64-clang
- CXX=o64-clang++
ldflags:
-s -w

- id: darwin-arm64
main: ./cmd/geth
binary: bor
goos:
- darwin
goarch:
- arm64
env:
- CC=oa64-clang
- CXX=oa64-clang++
ldflags:
-s -w

- id: linux-amd64
main: ./cmd/geth
binary: bor
goos:
- linux
goarch:
- amd64
env:
- CC=gcc
- CXX=g++
ldflags:
# We need to build a static binary because we are building in a glibc based system and running in a musl container
-s -w -linkmode external -extldflags "-static"

- id: linux-arm64
main: ./cmd/geth
binary: bor
goos:
- linux
goarch:
- arm64
env:
- CC=aarch64-linux-gnu-gcc
- CXX=aarch64-linux-gnu-g++
ldflags:
# We need to build a static binary because we are building in a glibc based system and running in a musl container
-s -w -linkmode external -extldflags "-static"

nfpms:
- vendor: 0xPolygon
homepage: https://polygon.technology
maintainer: Polygon Team <[email protected]>
description: Polygon Blockchain
license: GPLv3 LGPLv3

formats:
- apk
- deb
- rpm

contents:
- src: builder/files/bor.service
dst: /lib/systemd/system/bor.service
type: config

overrides:
rpm:
replacements:
amd64: x86_64

snapshot:
name_template: "{{ .Tag }}.next"

dockers:
- image_templates:
- 0xpolygon/{{ .ProjectName }}:{{ .Version }}-amd64
dockerfile: Dockerfile.release
use: buildx
goarch: amd64
ids:
- linux-amd64
build_flag_templates:
- --platform=linux/amd64
skip_push: true

- image_templates:
- 0xpolygon/{{ .ProjectName }}:{{ .Version }}-arm64
dockerfile: Dockerfile.release
use: buildx
goarch: arm64
ids:
- linux-arm64
build_flag_templates:
- --platform=linux/arm64
skip_push: true

docker_manifests:
- name_template: 0xpolygon/{{ .ProjectName }}:{{ .Version }}
image_templates:
- 0xpolygon/{{ .ProjectName }}:{{ .Version }}-amd64
- 0xpolygon/{{ .ProjectName }}:{{ .Version }}-arm64

- name_template: 0xpolygon/{{ .ProjectName }}:latest
image_templates:
- 0xpolygon/{{ .ProjectName }}:{{ .Version }}-amd64
- 0xpolygon/{{ .ProjectName }}:{{ .Version }}-arm64

announce:
slack:
enabled: true
# The name of the channel that the user selected as a destination for webhook messages.
channel: '#code-releases'
25 changes: 12 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
# Build Geth in a stock Go builder container
FROM golang:1.17-alpine as builder
FROM golang:latest

RUN apk add --no-cache make gcc musl-dev linux-headers git bash
ARG BOR_DIR=/bor
ENV BOR_DIR=$BOR_DIR

ADD . /bor
RUN cd /bor && make bor-all
RUN apt-get update -y && apt-get upgrade -y \
&& apt install build-essential git -y \
&& mkdir -p /bor

CMD ["/bin/bash"]
WORKDIR ${BOR_DIR}
COPY . .
RUN make bor-all

# Pull Bor into a second stage deploy alpine container
FROM alpine:latest
ENV SHELL /bin/bash
EXPOSE 8545 8546 8547 30303 30303/udp

RUN apk add --no-cache ca-certificates
COPY --from=builder /bor/build/bin/bor /usr/local/bin/
COPY --from=builder /bor/build/bin/bootnode /usr/local/bin/

EXPOSE 8545 8546 8547 30303 30303/udp
ENTRYPOINT ["bor"]
7 changes: 5 additions & 2 deletions Dockerfile.alltools
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ RUN cd /bor && make bor-all
# Pull all binaries into a second stage deploy alpine container
FROM alpine:latest

RUN apk add --no-cache ca-certificates
RUN set -x \
&& apk add --update --no-cache \
ca-certificates \
&& rm -rf /var/cache/apk/*
COPY --from=builder /bor/build/bin/* /usr/local/bin/

EXPOSE 8545 8546 30303 30303/udp
EXPOSE 8545 8546 30303 30303/udp
7 changes: 7 additions & 0 deletions Dockerfile.release
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM alpine:3.14

RUN apk add --no-cache ca-certificates
COPY bor /usr/local/bin/

EXPOSE 8545 8546 8547 30303 30303/udp
ENTRYPOINT ["bor"]
Loading

0 comments on commit a276c23

Please sign in to comment.