Skip to content

Commit

Permalink
Merge branch 'main' into gai/handle-duplicate-sig-error
Browse files Browse the repository at this point in the history
  • Loading branch information
gitferry committed Nov 13, 2024
2 parents e2e1f2a + cb8ea0b commit e280f33
Show file tree
Hide file tree
Showing 7 changed files with 131 additions and 7 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/changelog-reminder.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Changelog Reminder
on:
pull_request:
types: [assigned, opened, synchronize, reopened, labeled, unlabeled]
branches:
- main

jobs:
changelog_reminder:
uses: babylonlabs-io/.github/.github/workflows/reusable_changelog_reminder.yml@v0.7.0
secrets: inherit
4 changes: 0 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ jobs:
run-build: true
run-gosec: true
gosec-args: "-exclude-generated -exclude-dir=itest -exclude-dir=testutil ./..."

changelog_reminder:
uses: babylonlabs-io/.github/.github/workflows/reusable_changelog_reminder.yml@v0.7.0
secrets: inherit

docker_pipeline:
uses: babylonlabs-io/.github/.github/workflows/reusable_docker_pipeline.yml@v0.7.0
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
name: goreleaser

on:
push:
tags:
- '*'
release:
types: [published]

permissions:
contents: write

jobs:
release:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@
main
tmp/
build/
dist/

*.swp
52 changes: 52 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
project_name: covenant-emulator

builds:
- id: covd-linux-amd64
main: ./cmd/covd
binary: covd
hooks:
pre:
- wget https://github.com/CosmWasm/wasmvm/releases/download/{{ .Env.COSMWASM_VERSION }}/libwasmvm.x86_64.so -O /lib/libwasmvm_muslc.x86_64.so
goos:
- linux
goarch:
- amd64
flags:
- -mod=readonly
- -trimpath
ldflags:
- -w
- -s
tags:
- netgo

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

checksum:
name_template: "{{ .ProjectName }}_{{ .Version }}_checksums.txt"
algorithm: sha256

release:
github:
owner: babylonlabs-io
name: covenant-emulator

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

dist: dist
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,15 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)

## Unreleased

### Bug fixes

* [#30](https://github.com/babylonlabs-io/covenant-emulator/pull/30) Ignore duplicated sig error

### Improvements

* [#22](https://github.com/babylonlabs-io/covenant-emulator/pull/22) Go releaser setup
and move changelog reminder out

## v0.7.0

### Improvements
Expand Down
55 changes: 55 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,58 @@ update-changelog:
./scripts/update_changelog.sh $(sinceTag) $(upcomingTag)

.PHONY: update-changelog


###############################################################################
### Release ###
###############################################################################

# The below is adapted from https://github.com/osmosis-labs/osmosis/blob/main/Makefile
GO_VERSION := $(shell grep -E '^go [0-9]+\.[0-9]+' go.mod | awk '{print $$2}')
GORELEASER_IMAGE := ghcr.io/goreleaser/goreleaser-cross:v$(GO_VERSION)
COSMWASM_VERSION := $(shell go list -m github.com/CosmWasm/wasmvm/v2 | sed 's/.* //')

.PHONY: release-dry-run release-snapshot release
release-dry-run:
docker run \
--rm \
-e COSMWASM_VERSION=$(COSMWASM_VERSION) \
-v /var/run/docker.sock:/var/run/docker.sock \
-v `pwd`:/go/src/babylon \
-w /go/src/babylon \
$(GORELEASER_IMAGE) \
release \
--clean \
--skip=publish

release-snapshot:
docker run \
--rm \
-e COSMWASM_VERSION=$(COSMWASM_VERSION) \
-v /var/run/docker.sock:/var/run/docker.sock \
-v `pwd`:/go/src/babylon \
-w /go/src/babylon \
$(GORELEASER_IMAGE) \
release \
--clean \
--snapshot \
--skip=publish,validate \

# NOTE: By default, the CI will handle the release process.
# this is for manually releasing.
ifdef GITHUB_TOKEN
release:
docker run \
--rm \
-e GITHUB_TOKEN=$(GITHUB_TOKEN) \
-e COSMWASM_VERSION=$(COSMWASM_VERSION) \
-v /var/run/docker.sock:/var/run/docker.sock \
-v `pwd`:/go/src/babylon \
-w /go/src/babylon \
$(GORELEASER_IMAGE) \
release \
--clean
else
release:
@echo "Error: GITHUB_TOKEN is not defined. Please define it before running 'make release'."
endif

0 comments on commit e280f33

Please sign in to comment.