Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add release scripts, api docs #186

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 26 additions & 28 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,33 @@
---
name: release binary
# This workflow creates a release using goreleaser
# via the 'make release' command.

name: Create release

on:
release:
types: [created]
workflow_dispatch:
inputs:
release_tag:
description: "The desired tag for the release (e.g. v0.1.0)."
required: true

permissions:
contents: write

jobs:
release-alpine-static:
permissions: write-all
runs-on: ubuntu-latest
release:
name: Create release
runs-on: buildjet-4vcpu-ubuntu-2204
steps:
- name: Checkout
- name: Check out repository code
uses: actions/checkout@v4

- name: Docker compose
run: STAKE_TOKEN="uterp" TIMEOUT_COMMIT=500ms docker-compose up -d

- name: Copy binary
run: docker cp terpd_node_1:/usr/bin/terpd ./terpd

- name: Save sha256 sum
run: sha256sum ./terpd > ./terpd_sha256.txt

- name: Release
uses: softprops/action-gh-release@v1
with:
token: ${{ github.token }}
files: |
terpd
terpd_sha256.txt

- name: Dump docker logs on failure
if: failure()
uses: jwalton/gh-docker-logs@v2
fetch-depth: 0
ref: ${{ github.event.inputs.release_tag }}
- name: Make release
run: |
make release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: 🧹 Clean release folder
run: |
sudo rm -rf dist
228 changes: 228 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,228 @@
project_name: terpd

env:
- CGO_ENABLED=1

builds:
- id: terpd-darwin-amd64
main: ./cmd/terpd/main.go
binary: terpd
hooks:
pre:
- wget https://github.com/CosmWasm/wasmvm/releases/download/{{ .Env.COSMWASM_VERSION }}/libwasmvmstatic_darwin.a -O /lib/libwasmvmstatic_darwin.a
env:
- CC=o64-clang
- CGO_LDFLAGS=-L/lib
goos:
- darwin
goarch:
- amd64
flags:
- -mod=readonly
- -trimpath
ldflags:
- -X github.com/cosmos/cosmos-sdk/version.Name=terpnetwork
- -X github.com/cosmos/cosmos-sdk/version.AppName=terpd
- -X github.com/cosmos/cosmos-sdk/version.Version={{ .Version }}
- -X github.com/cosmos/cosmos-sdk/version.Commit={{ .Commit }}
- -X github.com/cosmos/cosmos-sdk/version.BuildTags=netgo,ledger,static_wasm
- -w -s
- -linkmode=external
tags:
- netgo
- ledger
- static_wasm

- id: terpd-darwin-arm64
main: ./cmd/terpd/main.go
binary: terpd
hooks:
pre:
- wget https://github.com/CosmWasm/wasmvm/releases/download/{{ .Env.COSMWASM_VERSION }}/libwasmvmstatic_darwin.a -O /lib/libwasmvmstatic_darwin.a
env:
- CC=oa64-clang
- CGO_LDFLAGS=-L/lib
goos:
- darwin
goarch:
- arm64
flags:
- -mod=readonly
- -trimpath
ldflags:
- -X github.com/cosmos/cosmos-sdk/version.Name=terpnetwork
- -X github.com/cosmos/cosmos-sdk/version.AppName=terpd
- -X github.com/cosmos/cosmos-sdk/version.Version={{ .Version }}
- -X github.com/cosmos/cosmos-sdk/version.Commit={{ .Commit }}
- -X github.com/cosmos/cosmos-sdk/version.BuildTags=netgo,ledger,static_wasm
- -w -s
- -linkmode=external
tags:
- netgo
- ledger
- static_wasm

- id: terpd-linux-amd64
main: ./cmd/terpd
binary: terpd
hooks:
pre:
- wget https://github.com/CosmWasm/wasmvm/releases/download/{{ .Env.COSMWASM_VERSION }}/libwasmvm_muslc.x86_64.a -O /usr/lib/x86_64-linux-gnu/libwasmvm_muslc.a
goos:
- linux
goarch:
- amd64
env:
- CC=x86_64-linux-gnu-gcc
flags:
- -mod=readonly
- -trimpath
ldflags:
- -X github.com/cosmos/cosmos-sdk/version.Name=terpnetwork
- -X github.com/cosmos/cosmos-sdk/version.AppName=terpd
- -X github.com/cosmos/cosmos-sdk/version.Version={{ .Version }}
- -X github.com/cosmos/cosmos-sdk/version.Commit={{ .Commit }}
- -X github.com/cosmos/cosmos-sdk/version.BuildTags=netgo,ledger,muslc,osusergo
- -w -s
- -linkmode=external
- -extldflags '-Wl,-z,muldefs -static -lm'
tags:
- netgo
- ledger
- muslc
- osusergo

- id: terpd-linux-arm64
main: ./cmd/terpd
binary: terpd
hooks:
pre:
- wget https://github.com/CosmWasm/wasmvm/releases/download/{{ .Env.COSMWASM_VERSION }}/libwasmvm_muslc.aarch64.a -O /usr/lib/aarch64-linux-gnu/libwasmvm_muslc.a
goos:
- linux
goarch:
- arm64
env:
- CC=aarch64-linux-gnu-gcc
flags:
- -mod=readonly
- -trimpath
ldflags:
- -X github.com/cosmos/cosmos-sdk/version.Name=terpnetwork
- -X github.com/cosmos/cosmos-sdk/version.AppName=terpd
- -X github.com/cosmos/cosmos-sdk/version.Version={{ .Version }}
- -X github.com/cosmos/cosmos-sdk/version.Commit={{ .Commit }}
- -X github.com/cosmos/cosmos-sdk/version.BuildTags=netgo,ledger,muslc,osusergo
- -w -s
- -linkmode=external
- -extldflags '-Wl,-z,muldefs -static -lm'
tags:
- netgo
- ledger
- muslc
- osusergo

universal_binaries:
- id: terpd-darwin-universal
ids:
- terpd-darwin-amd64
- terpd-darwin-arm64
replace: false

archives:
- id: zipped
builds:
# - terpd-darwin-universal
- terpd-linux-amd64
- terpd-linux-arm64
# - terpd-darwin-amd64
# - terpd-darwin-arm64
name_template: "{{.ProjectName}}-{{ .Version }}-{{ .Os }}-{{ .Arch }}"
format: tar.gz
files:
- none*
- id: binaries
builds:
# - terpd-darwin-universal
- terpd-linux-amd64
- terpd-linux-arm64
# - terpd-darwin-amd64
# - terpd-darwin-arm64
name_template: "{{.ProjectName}}-{{ .Version }}-{{ .Os }}-{{ .Arch }}"
format: binary
files:
- none*

checksum:
name_template: "sha256sum.txt"
algorithm: sha256

# Docs: https://goreleaser.com/customization/changelog/
changelog:
skip: true

# Docs: https://goreleaser.com/customization/release/
release:
github:
owner: osmosis-labs
name: osmosis
replace_existing_draft: true
header: |
< DESCRIPTION OF RELEASE >

## Changelog

See the full changelog [here](https://github.com/osmosis-labs/osmosis/blob/v{{ .Version }}/CHANGELOG.md)

## ⚡️ Binaries

Binaries for Linux (amd64 and arm64) are available below.

#### 🔨 Build from source

If you prefer to build from source, you can use the following commands:

````bash
git clone https://github.com/osmosis-labs/osmosis
cd osmosis && git checkout v{{ .Version }}
make install
````

## 🐳 Run with Docker

As an alternative to installing and running terpd on your system, you may run terpd in a Docker container.
The following Docker images are available in our registry:

| Image Name | Base | Description |
|----------------------------------------------|--------------------------------------|-----------------------------------|
| `terpnetwork/terp-core:{{ .Version }}` | `distroless/static-debian11` | Default image based on Distroless |
| `terpnetwork/terp-core:{{ .Version }}-distroless` | `distroless/static-debian11` | Distroless image (same as above) |
| `terpnetwork/terp-core:{{ .Version }}-nonroot` | `distroless/static-debian11:nonroot` | Distroless non-root image |
| `terpnetwork/terp-core:{{ .Version }}-alpine` | `alpine` | Alpine image |

Example run:

```bash
docker run terpnetwork/terp-core:{{ .Version }} version
# v{{ .Version }}
````

All the images support `arm64` and `amd64` architectures.

name_template: "Osmosis v{{.Version}} 🧪"
mode: replace
draft: true

# Docs: https://goreleaser.com/customization/announce/
# We could automatically announce the release in
# - discord
# - slack
# - twitter
# - webhooks
# - telegram
# - reddit
#
# announce:
# discord:
# enabled: true
# message_template: 'New {{.Tag}} is out!'
Loading
Loading