Skip to content

Commit

Permalink
fixed goreleaser (#185)
Browse files Browse the repository at this point in the history
kaustubhkapatral authored Jun 3, 2024
1 parent 7864085 commit 2c688a2
Showing 3 changed files with 116 additions and 29 deletions.
9 changes: 9 additions & 0 deletions .github/RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
## What's Changed
-
-


## New Contributors

-
-
49 changes: 20 additions & 29 deletions .github/workflows/goreleaser.yml
Original file line number Diff line number Diff line change
@@ -3,41 +3,32 @@ name: goreleaser
on:
push:
tags:
- '*'
- '**'
permissions:
contents: write

jobs:
goreleaser:

runs-on: ubuntu-latest

steps:
-
name: GCC multilib
run: |
sudo apt-get update
sudo apt-get install gcc-multilib g++-multilib clang
-
name: OSXCross for CGO Support
run: |
mkdir ../../osxcross
git clone https://github.com/likhita-809/osxcross-target.git ../../osxcross/target
sudo ln -s /home/runner/work/osxcross/target/target/lib/libcrypto.so.1.0.0 /usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0
-
name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
-
name: Set up Go
uses: actions/setup-go@v3
- name: Check out repo code
uses: actions/checkout@v4
with:
go-version: 1.19
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v3.1.0
fetch-depth: 0
ref: ${{ github.event.inputs.release_tag }}

- name: Setup go env
uses: actions/setup-go@v5
with:
go-version: "1.20"

- name: Set wasm env version
run: echo "COSMWASM_VERSION=$(go list -m github.com/CosmWasm/wasmvm | sed 's/.* //')" >> $GITHUB_ENV

- name: Release
uses: goreleaser/goreleaser-action@v5
with:
version: latest
args: release --rm-dist
args: release --clean --release-notes ./RELEASE_NOTES.md
env:
GITHUB_TOKEN: ${{ secrets.github_token }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
87 changes: 87 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
project_name: passage

env:
- CGO_ENABLED=1

builds:
- id: passage-linux-amd64
main: ./cmd/passage
binary: passage
hooks:
pre:
- sudo 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=passage
- -X github.com/cosmos/cosmos-sdk/version.AppName=passage
- -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

archives:
- id: zipped
builds:
- passage-linux-amd64
name_template: "{{.ProjectName}}-{{ .Version }}-{{ .Os }}-{{ .Arch }}"
format: tar.gz
files:
- none*
- id: binaries
builds:
- passage-linux-amd64
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: envadiv
name: Passage3D
replace_existing_draft: true
header: |
Binaries for Linux amd64 are available below.
name_template: "Passage3D v{{.Version}} "
mode: replace
draft: false

# 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!'

0 comments on commit 2c688a2

Please sign in to comment.