Skip to content

Commit

Permalink
fix(devops): update gosdk version on building (0chain#846)
Browse files Browse the repository at this point in the history
  • Loading branch information
cnlangzi authored Mar 14, 2023
1 parent 96dcca5 commit ea449e9
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/sdk-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
fi
- name: Build
run: CGO_ENABLED=0 GOOS=js GOARCH=wasm go build -o ./zcn.wasm ./wasmsdk
run: make wasm-build

- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ gosdk-build: gomod-download
go build -x -v -tags bn256 ./...

wasm-build: getrev
CGO_ENABLED=0 GOOS=js GOARCH=wasm go build -o sdk.wasm github.com/0chain/gosdk/wasmsdk
CGO_ENABLED=0 GOOS=js GOARCH=wasm go build -o ./zcn.wasm ./wasmsdk

wasm-test: wasm-build
env -i $(shell go env) PATH="$(shell go env GOROOT)/misc/wasm:$(PATH)" CGO_ENABLED=0 GOOS=js GOARCH=wasm go test -v github.com/0chain/gosdk/wasmsdk/jsbridge/...
Expand Down Expand Up @@ -78,7 +78,7 @@ lint: lint-wasm
golangci-lint run --skip-dirs wasmsdk


build-windows:
build-windows: getrev
@echo "Building 0Chain Windows SDK. Please wait..."
@go build --buildmode=c-shared -ldflags="-s -w" -o ./winsdk/zcn.windows.dll ./winsdk
@echo " ./winsdk/zcn.windows.dll - [OK]"
Expand Down
4 changes: 0 additions & 4 deletions PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
### Version
- [ ] Ensure to run `make getrev` to update gosdk version info.


### Changes
-

Expand Down
10 changes: 5 additions & 5 deletions _util/build_mobile.mk
Original file line number Diff line number Diff line change
Expand Up @@ -56,30 +56,30 @@ gomobile-install:
go install golang.org/x/mobile/cmd/gomobile@latest
gomobile init

build-iossimulator: $(IOSMOBILESDKDIR)
build-iossimulator: $(IOSMOBILESDKDIR) getrev
@echo "Building iOS Simulator framework. Please wait..."
@CGO_CFLAGS=$(MINIOSVERSIONMIN) gomobile bind -v -ldflags="-s -w" -target=iossimulator -tags "ios iossimulator mobile" -o $(IOSMOBILESDKDIR)/simulator/$(IOSBINNAME) $(PKG_EXPORTS)
@echo " $(IOSMOBILESDKDIR)/simulator/$(IOSBINNAME). - [OK]"

build-ios: $(IOSMOBILESDKDIR)
build-ios: $(IOSMOBILESDKDIR) getrev
@echo "Building iOS framework. Please wait..."
@go get golang.org/x/mobile/bind
@CGO_CFLAGS=$(MINIOSVERSIONMIN) gomobile bind -v -ldflags="-s -w" -target=ios,iossimulator -tags "ios mobile" -o $(IOSMOBILESDKDIR)/ios/$(IOSBINNAME) $(PKG_EXPORTS)
@echo " $(IOSMOBILESDKDIR)/ios/$(IOSBINNAME). - [OK]"

build-android: $(ANDROIDMOBILESDKDIR)
build-android: $(ANDROIDMOBILESDKDIR) getrev
@echo "Building Android framework. Please wait..."
@go get golang.org/x/mobile/bind
@gomobile bind -v -ldflags="-s -w -extldflags=-Wl,-soname,libgojni.so" -target=android/arm64,android/amd64 -androidapi 19 -tags mobile -o $(ANDROIDMOBILESDKDIR)/$(ANDROIDBINNAME) $(PKG_EXPORTS)
@echo " $(ANDROIDMOBILESDKDIR)/$(ANDROIDBINNAME). - [OK]"

build-android-debug: $(ANDROIDMOBILESDKDIR)
build-android-debug: $(ANDROIDMOBILESDKDIR) getrev
@echo "Building Android framework. Please wait..."
@go get golang.org/x/mobile/bind
@gomobile bind -v -ldflags="-s -w -extldflags=-Wl,-soname,libgojni.so" -gcflags '-N -l' -target=android/arm64,android/amd64 -tags mobile -o $(ANDROIDMOBILESDKDIR)/$(ANDROIDBINNAME) $(PKG_EXPORTS)
@echo " $(ANDROIDMOBILESDKDIR)/$(ANDROIDBINNAME). - [OK]"

build-macos: $(MACSDKDIR)
build-macos: $(MACSDKDIR) getrev
@echo "Building MAC framework. Please wait..."
@go get golang.org/x/mobile/bind
@CGO_CFLAGS=$(MINMACOSVERSIONMIN) gomobile bind -v -ldflags="-s -w" -target=macos -tags mobile -o $(MACSDKDIR)/$(IOSBINNAME) $(PKG_EXPORTS)
Expand Down

0 comments on commit ea449e9

Please sign in to comment.