-
Notifications
You must be signed in to change notification settings - Fork 342
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI: Generate binary supported both amd and arm (#847)
- Loading branch information
1 parent
78d6efc
commit 1028159
Showing
3 changed files
with
174 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,35 @@ | ||
--- | ||
name: Release Binary | ||
|
||
on: | ||
release: | ||
types: [created] | ||
|
||
permissions: | ||
contents: read | ||
packages: write | ||
name: Release Binary | ||
|
||
jobs: | ||
release: | ||
permissions: write-all | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- | ||
name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
- | ||
name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Docker compose | ||
run: docker-compose up -d | ||
|
||
- name: Copy binary | ||
run: docker cp dymension_node_1:/usr/local/bin/dymd ./dymd | ||
|
||
- name: Save sha256 sum | ||
run: sha256sum ./dymd > ./dymd_sha256.txt | ||
|
||
- name: Release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
token: ${{ github.token }} | ||
files: | | ||
dymd | ||
dymd_sha256.txt | ||
- name: Dump docker logs on failure | ||
if: failure() | ||
uses: jwalton/gh-docker-logs@v2 | ||
on: | ||
release: | ||
types: [created] | ||
|
||
permissions: write-all | ||
|
||
# This workflow creates a release using goreleaser | ||
# via the 'make release' command. | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
environment: release | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: '1.22' | ||
check-latest: true | ||
|
||
- name: Setup release environment | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: |- | ||
echo 'GITHUB_TOKEN=${{secrets.GITHUB_TOKEN}}' > .release-env | ||
- name: Release publish | ||
run: make release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
before: | ||
hooks: | ||
- go mod download | ||
|
||
builds: | ||
- id: "dymd-darwin" | ||
main: ./cmd/dymd | ||
binary: dymd | ||
env: | ||
- CGO_ENABLED=1 | ||
- CC=o64-clang | ||
- CXX=o64-clang++ | ||
goos: | ||
- darwin | ||
goarch: | ||
- amd64 | ||
flags: | ||
- -tags=cgo | ||
ldflags: | ||
- -s -w -X github.com/cosmos/cosmos-sdk/version.Name=dymension -X github.com/cosmos/cosmos-sdk/version.AppName=dymd -X github.com/cosmos/cosmos-sdk/version.Version={{.Version}} -X github.com/cosmos/cosmos-sdk/version.Commit={{.Commit}} | ||
- id: "dymd-darwin-arm64" | ||
main: ./cmd/dymd | ||
binary: dymd | ||
env: | ||
- CGO_ENABLED=1 | ||
- CC=oa64-clang | ||
- CXX=oa64-clang++ | ||
goos: | ||
- darwin | ||
goarch: | ||
- arm64 | ||
flags: | ||
- -tags=cgo | ||
ldflags: | ||
- -s -w -X github.com/cosmos/cosmos-sdk/version.Name=dymension -X github.com/cosmos/cosmos-sdk/version.AppName=dymd -X github.com/cosmos/cosmos-sdk/version.Version={{.Version}} -X github.com/cosmos/cosmos-sdk/version.Commit={{.Commit}} | ||
- id: "dymd-linux" | ||
main: ./cmd/dymd | ||
binary: dymd | ||
env: | ||
- CGO_ENABLED=1 | ||
- CC=gcc | ||
- CXX=g++ | ||
goos: | ||
- linux | ||
goarch: | ||
- amd64 | ||
flags: | ||
- -tags=cgo | ||
ldflags: | ||
- -s -w -X github.com/cosmos/cosmos-sdk/version.Name=dymension -X github.com/cosmos/cosmos-sdk/version.AppName=dymd -X github.com/cosmos/cosmos-sdk/version.Version={{.Version}} -X github.com/cosmos/cosmos-sdk/version.Commit={{.Commit}} | ||
- id: "dymd-linux-arm64" | ||
main: ./cmd/dymd | ||
binary: dymd | ||
env: | ||
- CGO_ENABLED=1 | ||
- CC=aarch64-linux-gnu-gcc | ||
- CXX=aarch64-linux-gnu-g++ | ||
goos: | ||
- linux | ||
goarch: | ||
- arm64 | ||
flags: | ||
- -tags=cgo | ||
ldflags: | ||
- -s -w -X github.com/cosmos/cosmos-sdk/version.Name=dymension -X github.com/cosmos/cosmos-sdk/version.AppName=dymd -X github.com/cosmos/cosmos-sdk/version.Version={{.Version}} -X github.com/cosmos/cosmos-sdk/version.Commit={{.Commit}} | ||
- id: "dymd-windows" | ||
main: ./cmd/dymd | ||
binary: dymd | ||
env: | ||
- CGO_ENABLED=1 | ||
- CC=x86_64-w64-mingw32-gcc | ||
- CXX=x86_64-w64-mingw32-g++ | ||
goos: | ||
- windows | ||
goarch: | ||
- amd64 | ||
flags: | ||
- -tags=cgo | ||
- -buildmode=exe | ||
ldflags: | ||
- -s -w -X github.com/cosmos/cosmos-sdk/version.Name=dymension -X github.com/cosmos/cosmos-sdk/version.AppName=dymd -X github.com/cosmos/cosmos-sdk/version.Version={{.Version}} -X github.com/cosmos/cosmos-sdk/version.Commit={{.Commit}} | ||
|
||
archives: | ||
- name_template: '{{ .ProjectName }}_{{ .Version }}_{{- title .Os }}_{{ .Arch }}' | ||
format_overrides: | ||
- goos: windows | ||
format: zip | ||
builds: | ||
- dymd-darwin | ||
- dymd-darwin-arm64 | ||
- dymd-windows | ||
- dymd-linux | ||
- dymd-linux-arm64 | ||
|
||
checksum: | ||
name_template: 'checksums.txt' | ||
changelog: | ||
sort: asc | ||
filters: | ||
exclude: | ||
- '^docs:' | ||
- '^test:' | ||
snapshot: | ||
name_template: "{{ .Tag }}-next" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters