-
Notifications
You must be signed in to change notification settings - Fork 532
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Release procedure. * Setting the slack channel for releases. * Update Dockerfile.release Co-authored-by: Victor Castell <[email protected]> * Update .goreleaser.yml Co-authored-by: Victor Castell <[email protected]> * Update .github/workflows/release.yml Co-authored-by: Victor Castell <[email protected]> Co-authored-by: Victor Castell <[email protected]>
- Loading branch information
1 parent
d9998a9
commit 5d71513
Showing
4 changed files
with
197 additions
and
0 deletions.
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,58 @@ | ||
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.16.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: | | ||
docker run \ | ||
--rm \ | ||
--privileged \ | ||
-e CGO_ENABLED=1 \ | ||
-e GITHUB_TOKEN \ | ||
-e DOCKER_USERNAME \ | ||
-e DOCKER_PASSWORD \ | ||
-e SLACK_WEBHOOK \ | ||
-v /var/run/docker.sock:/var/run/docker.sock \ | ||
-v `pwd`:/go/src/$(PACKAGE_NAME) \ | ||
-w /go/src/$(PACKAGE_NAME) \ | ||
ghcr.io/troian/golang-cross:${GOLANG_CROSS_VERSION} \ | ||
--rm-dist --skip-validate | ||
env: | ||
PACKAGE_NAME: github.com/0xPolygon/polygon-sdk | ||
GOLANG_CROSS_VERSION: v1.17.2 | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
VERSION: ${{ steps.prepare.outputs.tag_name }} | ||
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | ||
SLACK_CHANNEL: ${{ secrets.SLACK_CHANNEL }} | ||
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} | ||
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | ||
if: github.actor == 'lazartravica' |
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 |
---|---|---|
|
@@ -10,6 +10,7 @@ test-chain* | |
.idea | ||
|
||
# Exclude the build .exe file from version control | ||
dist/ | ||
main.exe | ||
main | ||
|
||
|
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,128 @@ | ||
project_name: polygon-sdk | ||
|
||
release: | ||
disable: false | ||
draft: true | ||
prerelease: auto | ||
|
||
builds: | ||
- id: darwin-amd64 | ||
main: ./main.go | ||
binary: polygon-sdk | ||
goos: | ||
- darwin | ||
goarch: | ||
- amd64 | ||
env: | ||
- CC=o64-clang | ||
- CXX=o64-clang++ | ||
ldflags: | ||
-s -w | ||
|
||
- id: darwin-arm64 | ||
main: ./main.go | ||
binary: polygon-sdk | ||
goos: | ||
- darwin | ||
goarch: | ||
- arm64 | ||
env: | ||
- CC=oa64-clang | ||
- CXX=oa64-clang++ | ||
ldflags: | ||
-s -w | ||
|
||
- id: linux-amd64 | ||
main: ./main.go | ||
binary: polygon-sdk | ||
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: ./main.go | ||
binary: polygon-sdk | ||
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 SDK Team <[email protected]> | ||
# description: A Framework for Building Ethereum-compatible Blockchain Networks | ||
# license: GPLv3 LGPLv3 | ||
# | ||
# formats: | ||
# - apk | ||
# - deb | ||
# - rpm | ||
# | ||
# contents: | ||
# - src: polygon-sdk.service | ||
# dst: /lib/systemd/system/polygon-sdk.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: false | ||
|
||
- image_templates: | ||
- 0xpolygon/{{ .ProjectName }}:{{ .Version }}-arm64 | ||
dockerfile: Dockerfile.release | ||
use: buildx | ||
goarch: arm64 | ||
ids: | ||
- linux-arm64 | ||
build_flag_templates: | ||
- --platform=linux/arm64 | ||
skip_push: false | ||
|
||
docker_manifests: | ||
- name_template: 0xpolygon/{{ .ProjectName }}:{{ .Version }} | ||
image_templates: | ||
- 0xpolygon/{{ .ProjectName }}:{{ .Version }}-amd64 | ||
- 0xpolygon/{{ .ProjectName }}:{{ .Version }}-arm64 | ||
skip_push: false | ||
|
||
- name_template: 0xpolygon/{{ .ProjectName }}:latest | ||
image_templates: | ||
- 0xpolygon/{{ .ProjectName }}:{{ .Version }}-amd64 | ||
- 0xpolygon/{{ .ProjectName }}:{{ .Version }}-arm64 | ||
skip_push: false | ||
|
||
announce: | ||
slack: | ||
enabled: true | ||
# The name of the channel that the user selected as a destination for webhook messages. | ||
channel: "{{ .Env.SLACK_CHANNEL }}" |
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,10 @@ | ||
FROM alpine:3.14 | ||
|
||
RUN set -x \ | ||
&& apk add --update --no-cache \ | ||
ca-certificates \ | ||
&& rm -rf /var/cache/apk/* | ||
COPY polygon-sdk /usr/local/bin/ | ||
|
||
EXPOSE 8545 9632 1478 | ||
ENTRYPOINT ["polygon-sdk"] |