(no commit message provided)

This commit is contained in:
Prad Nukala
2024-07-05 22:20:13 -04:00
committed by Prad Nukala (aider)
commit 5fd43dfd6b
457 changed files with 115535 additions and 0 deletions
+8
View File
@@ -0,0 +1,8 @@
---
title: New Testnet {{ date | date('dddd MMMM Do') }}
labels: enhancement
---
Server IP: {{ env.SERVER_IPV4_ADDR }}
SSH: `ssh -o StrictHostKeyChecking=no root@{{ env.SERVER_IPV4_ADDR }}`
Tag: {{ env.GITHUB_REF_NAME }} / Commit: {{ env.GITHUB_SHA }}
Local-Interchain API: http://{{ env.SERVER_IPV4_ADDR }}:{{ env.LOCALIC_PORT }}
+26
View File
@@ -0,0 +1,26 @@
name: Automatic Tag Bump
on:
pull_request:
types:
- closed
branches:
- main
jobs:
build:
if: github.event.pull_request.merged == true
runs-on: ubuntu-22.04
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.merge_commit_sha }}
fetch-depth: "0"
- name: Bump version and push tag
uses: anothrNick/github-tag-action@v1 # Don't use @master or @v1 unless you're happy to test the latest version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # if you don't want to set write permissions use a PAT token
WITH_V: true
PRERELEASE: true
+22
View File
@@ -0,0 +1,22 @@
name: Publish to buf.build/didao/sonr
on:
push:
permissions:
contents: write
issues: write
jobs:
buf_push:
runs-on: ubuntu-latest
steps:
# Run `git checkout`
- uses: actions/checkout@v2
# Install the `buf` CLI
- uses: bufbuild/buf-setup-action@v1
# Push only the Input in `proto` to the BSR
- uses: bufbuild/buf-push-action@v1
continue-on-error: true
with:
input: proto
buf_token: ${{ secrets.BUF_TOKEN }}
+71
View File
@@ -0,0 +1,71 @@
name: docker image release
# NOTE: For this action to work, you must enable write permissions in your github repository settings.
# Settings -> Actions -> General. "Workflow Permissions". Select "Read and write permissions".
# If you forget to enable, the action will fail on push with a 401 error. Just re-run the failed action after enabling.
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+" # ignore rc
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
GO_VERSION: 1.22
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
release-image:
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
# all lowercase ghcr registry
- run: |
DOCKER_REGISTRY=`echo "${{ env.REGISTRY }}/${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]'`
echo "DOCKER_REGISTRY=$DOCKER_REGISTRY" >> $GITHUB_ENV
REPO_NAME=`echo "${{ github.repository }}" | awk -F'/' '{print $2}' | tr '[:upper:]' '[:lower:]'`
echo "REPO_NAME=$REPO_NAME" >> $GITHUB_ENV
- name: Parse tag
id: tag
run: |
# v0.0.1
VERSION=$(echo ${{ github.ref_name }} | sed "s/v//")
# 0.0.1
echo "VERSION=$VERSION" >> $GITHUB_ENV
# build and publish package to ghcr (public) with codebase remaining private
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
# make sure to update package to be public in repo ghcr settings
- name: Build and push Docker image
uses: strangelove-ventures/heighliner-build-action@v1.0.0
with:
# v0.0.1
git-ref: ${{ github.ref_name }}
chain: ${{ env.REPO_NAME}}
dockerfile: cosmos
registry: ${{ env.DOCKER_REGISTRY }}
build-target: |
cd ..
make install
local: true
binaries: |
- /go/bin/sonrd
build-env: |
- BUILD_TAGS=muslc
+43
View File
@@ -0,0 +1,43 @@
name: "Release Binary"
# Pairs with .goreleaser.yaml file for configuration.
on:
push:
tags:
- '**'
# Test Locally with:
# goreleaser build --skip-validate --snapshot --clean
jobs:
goreleaser:
permissions: write-all
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2.3.4
with:
fetch-depth: 0
- uses: actions/setup-go@v2
with:
go-version: '1.21'
- name: Clean up dist directory
run: rm -rf dist
- name: Build
uses: goreleaser/goreleaser-action@v5
with:
version: latest
args: build --skip-validate
- name: Release
uses: goreleaser/goreleaser-action@v5
if: startsWith(github.ref, 'refs/tags/')
with:
version: latest
args: release --skip-validate --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+92
View File
@@ -0,0 +1,92 @@
name: cloud testnet
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+' # ignore rc
# https://github.com/<org>/<repo>/settings/secrets/actions/new
# - HCLOUD_TOKEN
# - SSH_PRIVATE_KEY
env:
GO_VERSION: 1.21.0
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
LOCALIC_PORT: 8080
LOCALIC_AUTH_KEY: ""
HETZNER_SSH_KEY: "reece-hetzner"
# HETZNER_MACHINE_TYPE: "cpx31" # shared 4vCPU ($7/Mo)
HETZNER_MACHINE_TYPE: "ccx23" # dedicated 4 CPU 16GB Ram ($25/Mo)
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
launch-testnet:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: TimDaub/hetzner-cloud-deploy-server-action@v2
with:
# gh-actions-tn-v1.0.0
server-name: "gh-actions-tn-${{github.ref_name}}"
server-image: "ubuntu-22.04"
server-type: ${{ env.HETZNER_MACHINE_TYPE }}
ssh-key-name: ${{ env.HETZNER_SSH_KEY }}
delete-server: false
startup-timeout: 40000 # ms
hcloud-token: ${{ secrets.HCLOUD_TOKEN }}
- name: Set env variables
run: |
mkdir -p ~/.ssh/ && ssh-keyscan -H $SERVER_IPV4 >> ~/.ssh/known_hosts
echo "SERVER_IPV4_ADDR=$SERVER_IPV4" >> $GITHUB_ENV
echo "GITHUB_SHA=${{github.sha}}" >> $GITHUB_ENV
echo "GITHUB_REF_NAME=${{ github.ref_name }}" >> $GITHUB_ENV
echo "LOCALIC_PORT=${{ env.LOCALIC_PORT }}" >> $GITHUB_ENV
- uses: JasonEtco/create-an-issue@v2.9.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
filename: .github/testnet.md
update_existing: true
- name: Testnet setup
uses: appleboy/ssh-action@v1.0.3
with:
host: ${{ env.SERVER_IPV4_ADDR }}
username: root
key: ${{ secrets.SSH_PRIVATE_KEY }}
port: 22
script: |
sudo apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt -y install make gcc jq bison ca-certificates curl
wget https://go.dev/dl/go1.22.1.linux-amd64.tar.gz
sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go1.22.1.linux-amd64.tar.gz
echo "export PATH=$PATH:/usr/local/go/bin" >> ~/.bashrc
export PATH=$PATH:/usr/local/go/bin
bash # idk if I can use this or not
sudo DEBIAN_FRONTEND=noninteractive apt-get remove -y containerd.io
sudo DEBIAN_FRONTEND=noninteractive apt-get -y install docker.io docker-compose
sudo apt-get update
wget https://github.com/strangelove-ventures/interchaintest/releases/download/v8.2.0/local-ic && chmod +x local-ic
sudo mv local-ic /usr/local/bin
git clone https://github.com/strangelove-ventures/heighliner.git && cd heighliner
go build && chmod +x heighliner
sudo mv heighliner /usr/local/bin
cd ~/
git clone https://github.com/${{ github.repository }}.git chain && cd chain
git checkout ${{ github.ref_name }}
make local-image
sudo screen -S testnet -d -m local-ic start ibc-testnet --api-address=0.0.0.0 --api-port=${{ env.LOCALIC_PORT }} --auth-key=${{ env.LOCALIC_AUTH_KEY }}
@@ -0,0 +1,65 @@
name: self-hosted testnet
#
# Setup a runner on your own hardware or in a public cloud like GCP, Hetzner, etc.
# This is required if your chain is closed source but you want a dev/semi-public testnet
# - https://github.com/<org>/<repo>/settings/actions/runners/new?arch=x64&os=linux
#
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+' # ignore rc
env:
GO_VERSION: 1.21.0
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
LOCALIC_PORT: 8080
LOCALIC_AUTH_KEY: ""
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
launch-testnet:
runs-on: self-hosted
steps:
- uses: actions/checkout@v3
- name: Setup System
run: |
sudo apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt -y install make gcc jq bison ca-certificates curl
wget https://go.dev/dl/go1.22.1.linux-amd64.tar.gz
sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go1.22.1.linux-amd64.tar.gz
echo "export PATH=$PATH:/usr/local/go/bin" >> ~/.bashrc
export PATH=$PATH:/usr/local/go/bin
sudo DEBIAN_FRONTEND=noninteractive apt-get remove -y containerd.io || true
sudo DEBIAN_FRONTEND=noninteractive apt-get -y install docker.io docker-compose
sudo apt-get update
wget https://github.com/strangelove-ventures/interchaintest/releases/download/v8.2.0/local-ic && chmod +x local-ic
sudo mv local-ic /usr/local/bin
git clone https://github.com/strangelove-ventures/heighliner.git && cd heighliner
go build && chmod +x heighliner
sudo mv heighliner /usr/local/bin
cd .. && rm -rf heighliner
- name: Build + Run Testnet
run: |
killall local-ic || true
docker kill $(docker ps -q) || true
export PATH=$PATH:/usr/local/go/bin
make local-image
sudo screen -S testnet-${{ github.ref_name }} -d -m local-ic start ibc-testnet --api-address=0.0.0.0 --api-port=${{ env.LOCALIC_PORT }} --auth-key=${{ env.LOCALIC_AUTH_KEY }}
# Add other commands here you perform for setup once local-ic has started (poll on LOCALIC_PORT) such as contract upload.
+26
View File
@@ -0,0 +1,26 @@
name: Unit tests
on:
push:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
GO_VERSION: 1.21
jobs:
tests:
runs-on: ubuntu-latest
steps:
- name: Check out source
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
check-latest: true
- name: Tests
run: make test