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

ci: fix goreleaser error and replace release-build #291

Merged
merged 2 commits into from
Oct 24, 2023
Merged
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
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

env:
- CGO_ENABLED=1

builds:
-
id: "finschia"
main: ./cmd/fnsad
binary: build/fnsad
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=finschia
- -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
binary: fnsad
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
- -X github.com/Finschia/finschia-sdk/version.AppName=fnsad
- -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
binary: fnsad
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
- -X github.com/Finschia/finschia-sdk/version.AppName=fnsad
- -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']
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ Ref: https://keepachangelog.com/en/1.0.0/

### Build, CI
* (ci) [\#290](https://github.com/Finschia/finschia/pull/290) remove autopr ci
* (ci) [\#291](https://github.com/Finschia/finschia/pull/291) fix goreleaser ci error and replace release-build

### Docs

Expand Down
Loading
Loading