Skip to content

Commit

Permalink
Merge branch 'main' into update-go
Browse files Browse the repository at this point in the history
  • Loading branch information
geoff-vball authored Sep 9, 2024
2 parents 97bd059 + be07363 commit 6a8c4a2
Show file tree
Hide file tree
Showing 9 changed files with 163 additions and 23 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Copyright (C) 2024, Ava Labs, Inc. All rights reserved.
# See the file LICENSE for licensing terms.

name: Release
name: Release awm-relayer

on:
push:
tags:
- "*"
- "awm-relayer/*"

jobs:
release:
Expand All @@ -17,12 +17,6 @@ jobs:
with:
submodules: recursive

# The GO_VERSION must be set explicitly to be used in the Dockerfile.
- name: Set Go version
run: |
source ./scripts/versions.sh
echo GO_VERSION=$GO_VERSION >> $GITHUB_ENV
- name: Set up Go
uses: actions/setup-go@v5
with:
Expand Down Expand Up @@ -66,9 +60,10 @@ jobs:
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
distribution: goreleaser-pro
version: latest
args: release --clean
args: release --clean --config relayer/.goreleaser.yml
env:
# https://docs.github.com/en/actions/security-guides/automatic-token-authentication#about-the-github_token-secret
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
69 changes: 69 additions & 0 deletions .github/workflows/release_signature_aggregator.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Copyright (C) 2024, Ava Labs, Inc. All rights reserved.
# See the file LICENSE for licensing terms.

name: Release signature-aggregator

on:
push:
tags:
- "signature-aggregator/*"

jobs:
release:
runs-on: ubuntu-22.04
steps:
- name: Git checkout
uses: actions/checkout@v4
with:
submodules: recursive

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'

- name: Set up arm64 cross compiler
run: |
sudo apt-get -y update
sudo apt-get -y install gcc-aarch64-linux-gnu
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Checkout osxcross
uses: actions/checkout@v4
with:
repository: tpoechtrager/osxcross
path: osxcross

- name: Build osxcross
run: |
sudo apt-get -y install clang llvm-dev libxml2-dev uuid-dev libssl-dev bash patch make tar xz-utils bzip2 gzip sed cpio libbz2-dev
cd osxcross
wget https://github.com/joseluisq/macosx-sdks/releases/download/12.3/$MACOS_SDK_FNAME -O tarballs/$MACOS_SDK_FNAME
echo $MACOS_SDK_CHECKSUM tarballs/$MACOS_SDK_FNAME | sha256sum -c -
UNATTENDED=1 ./build.sh
echo $PWD/target/bin >> $GITHUB_PATH
env:
MACOS_SDK_FNAME: MacOSX12.3.sdk.tar.xz
MACOS_SDK_CHECKSUM: 3abd261ceb483c44295a6623fdffe5d44fc4ac2c872526576ec5ab5ad0f6e26c

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser-pro
version: latest
args: release --clean --config signature-aggregator/.goreleaser.yml
env:
# https://docs.github.com/en/actions/security-guides/automatic-token-authentication#about-the-github_token-secret
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
7 changes: 0 additions & 7 deletions Dockerfile

This file was deleted.

2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require (
github.com/ava-labs/teleporter v1.0.6
github.com/aws/aws-sdk-go-v2 v1.30.5
github.com/aws/aws-sdk-go-v2/config v1.27.9
github.com/aws/aws-sdk-go-v2/service/kms v1.35.6
github.com/aws/aws-sdk-go-v2/service/kms v1.35.7
github.com/ethereum/go-ethereum v1.13.8
github.com/hashicorp/golang-lru/v2 v2.0.7
github.com/onsi/ginkgo/v2 v2.20.2
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.1 h1:EyBZibR
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.1/go.mod h1:JKpmtYhhPs7D97NL/ltqz7yCkERFW5dOlHyVl66ZYF8=
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.6 h1:b+E7zIUHMmcB4Dckjpkapoy47W6C9QBv/zoUP+Hn8Kc=
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.6/go.mod h1:S2fNV0rxrP78NhPbCZeQgY8H9jdDMeGtwcfZIRxzBqU=
github.com/aws/aws-sdk-go-v2/service/kms v1.35.6 h1:03MyCzKu/nQZRtHO7VZk1BAbSJvtv5whnfZweLdZxI0=
github.com/aws/aws-sdk-go-v2/service/kms v1.35.6/go.mod h1:K9lwD0Rsx9+NSaJKsdAdlDK4b2G4KKOEve9PzHxPoMI=
github.com/aws/aws-sdk-go-v2/service/kms v1.35.7 h1:v0D1LeMkA/X+JHAZWERrr+sUGOt8KrCZKnJA6KszkcE=
github.com/aws/aws-sdk-go-v2/service/kms v1.35.7/go.mod h1:K9lwD0Rsx9+NSaJKsdAdlDK4b2G4KKOEve9PzHxPoMI=
github.com/aws/aws-sdk-go-v2/service/sso v1.20.3 h1:mnbuWHOcM70/OFUlZZ5rcdfA8PflGXXiefU/O+1S3+8=
github.com/aws/aws-sdk-go-v2/service/sso v1.20.3/go.mod h1:5HFu51Elk+4oRBZVxmHrSds5jFXmFj8C3w7DVF2gnrs=
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.23.3 h1:uLq0BKatTmDzWa/Nu4WO0M1AaQDaPpwTKAeByEc6WFM=
Expand Down
9 changes: 6 additions & 3 deletions .goreleaser.yml → relayer/.goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# ref. https://goreleaser.com/customization/build/
project_name: awm-relayer
monorepo:
tag_prefix: awm-relayer/
builds:
- id: awm-relayer
main: ./relayer/main/main.go
Expand Down Expand Up @@ -35,14 +38,14 @@ dockers:
build_flag_templates:
- "--pull"
- "--platform=linux/amd64"
- "--build-arg=GO_VERSION={{ .Env.GO_VERSION }}"
dockerfile: "relayer/Dockerfile"
- image_templates:
- 'avaplatform/awm-relayer:{{ .Tag }}-arm64'
use: buildx
build_flag_templates:
- "--pull"
- "--platform=linux/arm64"
- "--build-arg=GO_VERSION={{ .Env.GO_VERSION }}"
dockerfile: "relayer/Dockerfile"
goarch: arm64
docker_manifests:
- name_template: 'avaplatform/awm-relayer:{{ .Tag }}'
Expand All @@ -62,4 +65,4 @@ release:
owner: ava-labs
name: awm-relayer
# If tag indicates rc, will mark it as prerelease
prerelease: auto
prerelease: auto
6 changes: 6 additions & 0 deletions relayer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM debian:11-slim
COPY awm-relayer /usr/bin/awm-relayer
EXPOSE 8080
USER 1001
CMD ["start"]
ENTRYPOINT [ "/usr/bin/awm-relayer" ]
68 changes: 68 additions & 0 deletions signature-aggregator/.goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# ref. https://goreleaser.com/customization/build/
project_name: signature-aggregator
monorepo:
tag_prefix: signature-aggregator/
builds:
- id: signature-aggregator
main: ./signature-aggregator/main/main.go
binary: signature-aggregator
flags:
- -v
# windows is ignored by default, as the `goos` field by default only
# contains linux and darwin
goos:
- linux
- darwin
goarch:
- amd64
- arm64
env:
- CGO_ENABLED=1
- CGO_CFLAGS=-O -D__BLST_PORTABLE__ # Set the CGO flags to use the portable version of BLST
overrides:
- goos: linux
goarch: arm64
env:
- CC=aarch64-linux-gnu-gcc
- goos: darwin
goarch: arm64
env:
- CC=oa64-clang
ignore:
- goos: darwin
goarch: amd64
dockers:
- image_templates:
- 'avaplatform/signature-aggregator:{{ .Tag }}-amd64'
use: buildx
build_flag_templates:
- "--pull"
- "--platform=linux/amd64"
dockerfile: "signature-aggregator/Dockerfile"
- image_templates:
- 'avaplatform/signature-aggregator:{{ .Tag }}-arm64'
use: buildx
build_flag_templates:
- "--pull"
- "--platform=linux/arm64"
dockerfile: "signature-aggregator/Dockerfile"
goarch: arm64
docker_manifests:
- name_template: 'avaplatform/signature-aggregator:{{ .Tag }}'
image_templates:
- 'avaplatform/signature-aggregator:{{ .Tag }}-amd64'
- 'avaplatform/signature-aggregator:{{ .Tag }}-arm64'
- name_template: 'avaplatform/signature-aggregator:latest'
image_templates:
- 'avaplatform/signature-aggregator:{{ .Tag }}-amd64'
- 'avaplatform/signature-aggregator:{{ .Tag }}-arm64'
# If tag is an rc, do not push the latest tag
skip_push: auto
release:
# Repo in which the release will be created.
# Default is extracted from the origin remote URL or empty if its private hosted.
github:
owner: ava-labs
name: awm-relayer
# If tag indicates rc, will mark it as prerelease
prerelease: auto
6 changes: 6 additions & 0 deletions signature-aggregator/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM debian:11-slim
COPY signature-aggregator /usr/bin/signature-aggregator
EXPOSE 8080
EXPOSE 8081
CMD ["start"]
ENTRYPOINT [ "/usr/bin/signature-aggregator" ]

0 comments on commit 6a8c4a2

Please sign in to comment.