This repository has been archived by the owner on Oct 18, 2023. It is now read-only.
forked from ledgerwatch/erigon
-
Notifications
You must be signed in to change notification settings - Fork 28
[DVT-85] add goreleaser to erigon github actions #3
Merged
Merged
Changes from 14 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
d9954fa
initial commit
cadef43
cleanup sevice names
18c4fc1
no slack webhook
611f661
adjust env var names
ab22754
git submodules
8f43d1f
adjust dockerfile copy
da3329a
makefile force
0295d43
adjust makefile
e5b5062
add make as extra_file
afc25cb
tweak goreleaser config
091ae61
simplify dockerfile.release
4cd0c87
change from dryrun
2c071d4
adjust execstart
dce747e
no dry run
e73d47d
have nfpms be followup
136d219
remove dry run
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
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.18.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.GIT_TOKEN }} | ||
VERSION: ${{ steps.prepare.outputs.tag_name }} | ||
DOCKER_USERNAME: ${{ secrets.DOCKERHUB }} | ||
DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_KEY }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,4 +74,6 @@ go.work | |
|
||
/goerli | ||
|
||
docker-compose.*.yml | ||
docker-compose.*.yml | ||
|
||
dist |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
project_name: erigon | ||
|
||
release: | ||
disable: false | ||
draft: true | ||
prerelease: auto | ||
|
||
builds: | ||
- id: darwin-amd64 | ||
main: ./cmd/erigon | ||
binary: erigon | ||
goos: | ||
- darwin | ||
goarch: | ||
- amd64 | ||
env: | ||
- CC=o64-clang | ||
- CXX=o64-clang++ | ||
tags: | ||
- netgo | ||
ldflags: | ||
-s -w | ||
|
||
- id: darwin-arm64 | ||
main: ./cmd/erigon | ||
binary: erigon | ||
goos: | ||
- darwin | ||
goarch: | ||
- arm64 | ||
env: | ||
- CC=oa64-clang | ||
- CXX=oa64-clang++ | ||
tags: | ||
- netgo | ||
ldflags: | ||
-s -w | ||
|
||
- id: linux-amd64 | ||
main: ./cmd/erigon | ||
binary: erigon | ||
goos: | ||
- linux | ||
goarch: | ||
- amd64 | ||
env: | ||
- CC=gcc | ||
- CXX=g++ | ||
tags: | ||
- netgo | ||
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 -extldflags "-static" | ||
|
||
- id: linux-arm64 | ||
main: ./cmd/erigon | ||
binary: erigon | ||
goos: | ||
- linux | ||
goarch: | ||
- arm64 | ||
env: | ||
- CC=aarch64-linux-gnu-gcc | ||
- CXX=aarch64-linux-gnu-g++ | ||
tags: | ||
- netgo | ||
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 -extldflags "-static" | ||
|
||
nfpms: | ||
- vendor: 0xPolygon | ||
homepage: https://polygon.technology | ||
maintainer: Polygon Team <team@polygon.technology> | ||
description: Polygon Blockchain | ||
license: GPLv3 LGPLv3 | ||
|
||
formats: | ||
- apk | ||
- deb | ||
- rpm | ||
|
||
contents: | ||
- src: builder/files/erigon.service | ||
dst: /lib/systemd/system/erigon.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 | ||
|
||
- image_templates: | ||
- 0xpolygon/{{ .ProjectName }}:{{ .Version }}-arm64 | ||
dockerfile: Dockerfile.release | ||
use: buildx | ||
goarch: arm64 | ||
ids: | ||
- linux-arm64 | ||
build_flag_templates: | ||
- --platform=linux/arm64/v8 | ||
|
||
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: false | ||
# The name of the channel that the user selected as a destination for webhook messages. | ||
channel: '#code-releases' |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
FROM alpine:3.14 | ||
|
||
RUN apk add --no-cache ca-certificates && \ | ||
mkdir -p /etc/erigon | ||
COPY erigon /usr/local/bin/ | ||
|
||
EXPOSE 8545 8551 8546 30303 30303/udp 42069 42069/udp 8080 9090 6060 | ||
ENTRYPOINT ["erigon"] |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
[Unit] | ||
Description=erigon | ||
StartLimitIntervalSec=500 | ||
StartLimitBurst=5 | ||
|
||
[Service] | ||
Restart=on-failure | ||
RestartSec=5s | ||
ExecStart=/usr/local/bin/erigon \ | ||
--chain=mumbai \ | ||
# --chain=mainnet \ | ||
--datadir /var/lib/erigon/data \ | ||
--metrics \ | ||
--metrics.prometheus-addr="127.0.0.1:9090" \ | ||
--syncmode 'full' \ | ||
--miner.gasprice '30000000000' \ | ||
--miner.gaslimit '20000000' \ | ||
--miner.gastarget '20000000' \ | ||
--txpool.nolocals \ | ||
--txpool.accountslots 16 \ | ||
--txpool.globalslots 32768 \ | ||
--txpool.accountqueue 16 \ | ||
--txpool.globalqueue 32768 \ | ||
--txpool.pricelimit '30000000000' \ | ||
--txpool.lifetime '1h30m0s' \ | ||
--bootnodes "enode://0cb82b395094ee4a2915e9714894627de9ed8498fb881cec6db7c65e8b9a5bd7f2f25cc84e71e89d0947e51c76e85d0847de848c7782b13c0255247a6758178c@44.232.55.71:30303,enode://88116f4295f5a31538ae409e4d44ad40d22e44ee9342869e7d68bdec55b0f83c1530355ce8b41fbec0928a7d75a5745d528450d30aec92066ab6ba1ee351d710@159.203.9.164:30303" | ||
WorkingDirectory=$NODE_DIR | ||
Type=simple | ||
User=$USER | ||
KillSignal=SIGINT | ||
TimeoutStopSec=120 | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you have to specify the
bindir
for nfpm or does it default to this locationThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
manually copy erigon binary to this dir in dockerfile.release here: https://github.com/maticnetwork/erigon/pull/3/files#diff-701366a9e47be6026c2b3a9cc9484a02f319b9b8469b28e907ac1237fe2456caR5