forked from ava-labs/icm-services
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request ava-labs#180 from ava-labs/release-job
Release Job
- Loading branch information
Showing
4 changed files
with
136 additions
and
43 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,76 @@ | ||
# Copyright (C) 2024, Ava Labs, Inc. All rights reserved. | ||
# See the file LICENSE for licensing terms. | ||
|
||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- "*" | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Git checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
path: awm-relayer | ||
|
||
- name: Set Go version | ||
run: | | ||
source ./awm-relayer/scripts/versions.sh | ||
echo GO_VERSION=$GO_VERSION >> $GITHUB_ENV | ||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: ${{ env.GO_VERSION }} | ||
|
||
- 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@v3 | ||
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@v5 | ||
with: | ||
distribution: goreleaser | ||
version: latest | ||
args: release --clean | ||
workdir: ./awm-relayer/ | ||
env: | ||
# https://docs.github.com/en/actions/security-guides/automatic-token-authentication#about-the-github_token-secret | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
DOCKERFILE: ./Dockerfile.release |
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,57 @@ | ||
# ref. https://goreleaser.com/customization/build/ | ||
builds: | ||
- id: awm-relayer | ||
main: ./main/main.go | ||
binary: awm-relayer | ||
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/awm-relayer:{{ .Tag }}-amd64' | ||
dockerfile: "{{ .Env.DOCKERFILE }}" | ||
use: buildx | ||
build_flag_templates: | ||
- "--pull" | ||
- "--platform=linux/amd64" | ||
- image_templates: | ||
- 'avaplatform/awm-relayer:{{ .Tag }}-arm64' | ||
dockerfile: "{{ .Env.DOCKERFILE }}" | ||
use: buildx | ||
build_flag_templates: | ||
- "--pull" | ||
- "--platform=linux/arm64" | ||
goarch: arm64 | ||
docker_manifests: | ||
- name_template: 'avaplatform/awm-relayer:{{ .Tag }}' | ||
image_templates: | ||
- 'avaplatform/awm-relayer:{{ .Tag }}-amd64' | ||
- 'avaplatform/awm-relayer:{{ .Tag }}-arm64' | ||
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 |
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,3 @@ | ||
FROM debian:11-slim | ||
COPY awm-relayer /usr/bin/awm-relayer | ||
ENTRYPOINT [ "/usr/bin/awm-relayer" ] |