Skip to content

Commit

Permalink
Merge pull request #21 from zemyblue/feat/apply_v2.0.1
Browse files Browse the repository at this point in the history
feat: apply the changes of Finschia v2.0.1
  • Loading branch information
zemyblue authored Nov 8, 2023
2 parents 9093f01 + 02df7c4 commit 8772503
Show file tree
Hide file tree
Showing 13 changed files with 1,791 additions and 7,291 deletions.
150 changes: 0 additions & 150 deletions .github/workflows/release-build.yml

This file was deleted.

26 changes: 17 additions & 9 deletions .github/workflows/tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,31 @@ name: Release
# This workflow helps with creating releases.
# This job will only be triggered when a tag (vX.X.x) is pushed
on:
# can be used to re-release an existing tag
workflow_dispatch:

push:
# Sequence of patterns matched against refs/tags
tags:
- "v[0-9]+.[0-9]+.[0-9]+" # Push events to matching v*, i.e. v1.0, v20.15.10
- "v[0-9]+.[0-9]+.[0-9]+*" # Push events to matching v*, i.e. v1.0, v20.15.10

permissions:
contents: write
packages: write

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: '1.20'
- name: Create release
uses: goreleaser/goreleaser-action@v4
- uses: actions/checkout@v4
with:
args: release --clean --release-notes ./RELEASE_CHANGELOG.md
fetch-depth: 0
ref: ${{ github.event.inputs.release_tag }}

- run: git fetch --force --tags

- name: Build & publish release
run: |
make release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
146 changes: 107 additions & 39 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,44 +1,112 @@
# This is an example goreleaser.yaml file with some sane defaults.
# Make sure to check the documentation at http://goreleaser.com
before:
hooks:
# you may remove this if you don't need go generate
- go generate ./...
project_name: fnsad-proxy

env:
- CGO_ENABLED=1

builds:
-
id: "finschia"
main: ./cmd/fnsad-proxy
binary: build/fnsad-proxy
env:
- CGO_ENABLED=0
flags:
- -mod=readonly
- -tags=netgo ledger
ldflags:
- -X github.com/Finschia/finschia-sdk/version.Name=finschia
- -X github.com/Finschia/finschia-sdk/version.ServerName=fnsad-proxy
- -X github.com/Finschia/finschia-sdk/version.Version={{ .Version }}
- -X github.com/Finschia/finschia-sdk/version.Commit={{ .FullCommit }}
- -X "github.com/Finschia/finschia-sdk/version.BuildTags=netgo,ledger"
- id: darwin
main: ./cmd/fnsad-proxy
binary: fnsad-proxy
hooks:
pre:
- wget https://github.com/Finschia/wasmvm/releases/download/{{ .Env.WASMVM_VERSION }}/libwasmvmstatic_darwin.a -O /lib/libwasmvmstatic_darwin.a
goos:
- darwin
goarch:
- amd64
- arm64
env:
- CC=o64-clang
- CGO_LDFLAGS=-L/lib
flags:
- -mod=readonly
- -trimpath
ldflags:
- -X github.com/Finschia/finschia-sdk/version.Name=finschia-proxy
- -X github.com/Finschia/finschia-sdk/version.AppName=fnsad-proxy
- -X github.com/Finschia/finschia-sdk/version.Version={{ .Version }}
- -X github.com/Finschia/finschia-sdk/version.Commit={{ .Commit }}
- -X github.com/Finschia/finschia-sdk/types.DBBackend=goleveldb
- -X github.com/Finschia/finschia-sdk/version.BuildTags=netgo,ledger,static_wasm
- -X github.com/Finschia/ostracon/version.TMCoreSemVer={{ .Env.OST_VERSION }}
- -s -w
- -linkmode=external
tags:
- netgo
- ledger
- static_wasm
overrides:
- goos: darwin
goarch: arm64
env:
- CC=oa64-clang

- id: linux
main: ./cmd/fnsad-proxy
binary: fnsad-proxy
hooks:
pre:
- wget https://github.com/Finschia/wasmvm/releases/download/{{ .Env.WASMVM_VERSION }}/libwasmvm_muslc.x86_64.a -O /usr/lib/x86_64-linux-gnu/libwasmvm_muslc.a
- wget https://github.com/Finschia/wasmvm/releases/download/{{ .Env.WASMVM_VERSION }}/libwasmvm_muslc.aarch64.a -O /usr/lib/aarch64-linux-gnu/libwasmvm_muslc.a
goos:
- linux
goarch:
- amd64
- arm64
env:
- CC=x86_64-linux-gnu-gcc
flags:
- -mod=readonly
- -trimpath
ldflags:
- -X github.com/Finschia/finschia-sdk/version.Name=finschia-proxy
- -X github.com/Finschia/finschia-sdk/version.AppName=fnsad-proxy
- -X github.com/Finschia/finschia-sdk/version.Version={{ .Version }}
- -X github.com/Finschia/finschia-sdk/version.Commit={{ .Commit }}
- -X github.com/Finschia/finschia-sdk/types.DBBackend=goleveldb
- -X "github.com/Finschia/finschia-sdk/version.BuildTags=netgo,osusergo,ledger,muslc"
- -X github.com/Finschia/ostracon/version.TMCoreSemVer={{ .Env.OST_VERSION }}
- -w -s
- -linkmode=external
- -extldflags '-Wl,-z,muldefs -static -lm'
tags:
- netgo
- osusergo
- ledger
- muslc
overrides:
- goos: linux
goarch: arm64
env:
- CC=aarch64-linux-gnu-gcc

universal_binaries:
- id: darwin

archives:
-
builds: ['fnsad-proxy']
replacements:
darwin: Darwin
linux: Linux
windows: Windows
386: i386
amd64: x86_64
files:
- LICENSE
- docs/getting-started/*
# disables archiving; to enable use commented lines below
- id: binaries
format: binary
name_template: "{{ .ProjectName }}-{{ .Version }}-{{ .Os }}-{{ .Arch }}"

# - id: zip
# format: tar.gz
# wrap_in_directory: true
# name_template: "{{ .ProjectName }}-{{ .Version }}-{{ .Os }}-{{ .Arch }}"
# files:
# - LICENSE
# - RELEASE_CHANGELOG.md

release:
name_template: "v{{.Version}}"
draft: true

checksum:
name_template: 'checksums.txt'
name_template: "sha256sum-v{{ .Version }}.txt"
algorithm: sha256

snapshot:
name_template: "{{ .Tag }}-next"
name_template: SNAPSHOT-{{ .Commit }}

changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
skip: false
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ Ref: https://keepachangelog.com/en/1.0.0/
### Docs

<!-- Release links -->
[Unreleased]: https://github.com/Finschia/finschia/compare/v2.0.0...HEAD
[Unreleased]: https://github.com/Finschia/finschia/compare/v2.0.1...HEAD
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ RUN ARCH=$(uname -m) && WASMVM_VERSION=$(go list -m github.com/Finschia/wasmvm |
# Add source files
COPY . .

# Build fnsad binary
# Build fnsad-proxy binary
RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/root/go/pkg/mod \
GOWORK=off go build \
-mod=readonly \
-tags "netgo,ledger,muslc,goleveldb" \
-ldflags \
"-X github.com/Finschia/finschia-sdk/version.Name=finschia \
-X github.com/Finschia/finschia-sdk/version.AppName=fnsad \
"-X github.com/Finschia/finschia-sdk/version.Name=finschia-proxy \
-X github.com/Finschia/finschia-sdk/version.AppName=fnsad-proxy \
-X github.com/Finschia/finschia-sdk/version.Version=${GIT_VERSION} \
-X github.com/Finschia/finschia-sdk/version.Commit=${GIT_COMMIT} \
-X github.com/Finschia/ostracon/version.TMCoreSemVer=${OST_VERSION} \
Expand Down
Loading

0 comments on commit 8772503

Please sign in to comment.