version 181 (#2410) #209
Workflow file for this run
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
name: Release | |
on: | |
push: | |
tags: | |
- "*" | |
branches: | |
- acp-77 | |
jobs: | |
# First confirm that the linting and unit tests pass at this commit prior to creating release artifacts. | |
lint: | |
uses: ./.github/workflows/lint.yml | |
unit_test: | |
uses: ./.github/workflows/unit-test.yml | |
release: | |
needs: [lint, unit_test] | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- 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: 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: 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_PASS }} | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Build Docker Image with acp77-latest tag | |
if: github.ref == 'refs/heads/acp-77' # special case for acp-77 branch | |
run: | | |
docker buildx build --pull --push --platform=linux/amd64,linux/arm64 \ | |
-t avaplatform/avalanche-cli:acp77-latest \ | |
-f ./Dockerfile . | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
TELEMETRY_TOKEN: ${{ secrets.POSTHOG_PROD_TOKEN }} | |
- name: Run GoReleaser | |
if: github.ref != 'refs/heads/acp-77' # skip for acp-77 branch | |
uses: goreleaser/goreleaser-action@v2 | |
with: | |
distribution: goreleaser | |
version: 'v2.3.2' | |
args: release --clean | |
env: | |
# https://docs.github.com/en/actions/security-guides/automatic-token-authentication#about-the-github_token-secret | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
TELEMETRY_TOKEN: ${{ secrets.POSTHOG_PROD_TOKEN }} | |
DOCKERFILE: ./Dockerfile.release |