Skip to content

Commit

Permalink
build: Multi-platform AMD64/ARM64 for Linux (#366)
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Nikitin <andrew.nikitin@evernym.com>
Co-authored-by: Ankur Banerjee <ankurdotb@users.noreply.github.com>
  • Loading branch information
Andrew Nikitin and ankurdotb committed Aug 16, 2022
1 parent 7485eb2 commit 2fc6ae5
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 17 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@ jobs:
- uses: actions/setup-go@v3
with:
go-version-file: ./go.mod
cache: true

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v3
with:
distribution: goreleaser
version: latest
args: build --rm-dist --snapshot --single-target
args: build --rm-dist --snapshot --id ubuntu-latest-amd64

- name: Store artifact
uses: actions/upload-artifact@v3
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,6 @@ jobs:
tags: |
type=semver,pattern={{version}},value=${{ needs.release-binary.outputs.RELEASE_VERSION }}
labels: |
org.opencontainers.image.title="cheqd Node Docker Image"
org.opencontainers.image.description="Node for cheqd network"
org.opencontainers.image.source="https://github.com/cheqd/cheqd-node"
org.opencontainers.image.vendor="Cheqd Foundation Limited"
org.opencontainers.image.created={{date 'dddd, MMMM Do YYYY, h:mm:ss a'}}
org.opencontainers.image.documentation="https://docs.cheqd.io/node"
Expand Down
36 changes: 24 additions & 12 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,36 @@ before:
- make clean
- go mod tidy
- go mod download
- make proto-gen

builds:
- id: cheqd-linux
- id: ubuntu-latest-amd64
main: ./cmd/cheqd-noded
binary: cheqd-noded
targets:
- "linux_amd64"
env:
- CGO_ENABLED=1
flags:
- -mod=readonly
- -tags="netgo ledger"
- -trimpath
ldflags:
- -s -w
- -X github.com/cosmos/cosmos-sdk/version.Name=cheqd-noded
- -X github.com/cosmos/cosmos-sdk/version.AppName=cheqd-noded
- -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,goleveldb

- id: ubuntu-latest-arm64
main: ./cmd/cheqd-noded
binary: cheqd-noded
targets:
- linux_amd64
- "linux_arm64"
hooks:
pre: make proto-gen
pre:
- sudo apt update && sudo apt install clang gcc-multilib g++-multilib -y
flags:
- -mod=readonly
- -tags="netgo ledger"
Expand All @@ -33,6 +52,7 @@ builds:
- -X github.com/cosmos/cosmos-sdk/version.Commit={{ .Commit }}
- -X github.com/cosmos/cosmos-sdk/version.BuildTags=netgo,ledger,goleveldb


archives:
- id: release-archives
replacements:
Expand All @@ -51,7 +71,6 @@ checksum:

changelog:
use: github-native
sort: asc
groups:
- title: Features
regexp: "^.*feat[(\\w)]*:+.*$"
Expand All @@ -70,14 +89,7 @@ changelog:
order: 4
- title: 'Other changes'
order: 999
filters:
exclude:
- '^docs'
- '^test'
- '^ci'
- '^refactor'
- '^revert'
- '^style'


release:
github:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "cheqd-node",
"version": "1.0.0",
"description": "DID Resolver for did:cheqd method",
"description": "Ledger/node code for cheqd network",
"license": "Apache-2.0",
"author": "Cheqd Foundation Limited (https://github.com/cheqd)",
"homepage": "https://github.com/cheqd/cheqd-node#readme",
Expand Down

0 comments on commit 2fc6ae5

Please sign in to comment.