-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add patch to build for ios * update the readme file * add cocoapods spec * add github action for cocoapods builds * add cocoapods bundler * typo fix * add gomobile init * small fix * add release perm * small fix --------- Co-authored-by: Homayoun <[email protected]>
- Loading branch information
Showing
4 changed files
with
98 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Build for iOS | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
build: | ||
name: Build & check fula mobile for ios | ||
runs-on: macos-latest | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Set up Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: "1.19.x" | ||
- name: Go information | ||
run: | | ||
go version | ||
go env | ||
- name: Run tests | ||
run: go test -v -shuffle=on ./mobile | ||
|
||
- name: Build the artifact | ||
if: startsWith(github.ref, 'refs/tags/') | ||
run: make fula-xcframework | ||
|
||
- name: Release | ||
uses: softprops/action-gh-release@v1 | ||
# if: startsWith(github.ref, 'refs/tags/') | ||
with: | ||
files: | | ||
build/cocoapods-bundle.zip | ||
build/cocoapods-bundle.zip.sha256 |
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,19 @@ | ||
Pod::Spec.new do |s| | ||
s.name = 'FulaMobile' # Name for your pod | ||
s.version = '0.1.6' | ||
s.summary = 'Go-fula for iOS' | ||
s.homepage = 'https://github.com/functionland/go-fula' | ||
|
||
s.author = { 'Functionland' => '[email protected]' } | ||
s.license = { :type => 'MIT', :file => 'LICENSE' } | ||
|
||
s.platform = :ios | ||
# change the source location | ||
s.source = { :http => "https://github.com/functionland/go-fula/releases/download/v#{s.version}/cocoapods-bundle.zip" } | ||
s.source_files = "include/*.{h}" | ||
s.module_map = "include/module.modulemap" | ||
s.ios.deployment_target = '11.0' | ||
s.ios.vendored_libraries = 'Fula' | ||
s.osx.vendored_libraries = 'Fula' | ||
s.static_framework = true | ||
end |
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,35 @@ | ||
GO_MOD_REPLACEMENT=replace github.com/raulk/go-watchdog => ./tmp-fula-build/go-watchdog | ||
all: | ||
go test ./... | ||
|
||
fula-xcframework: patch-go-watchdog prepare-gomobile build-fula-xcframework bundles | ||
patch-go-watchdog: | ||
mkdir -p tmp-fula-build &&\ | ||
cd tmp-fula-build &&\ | ||
git clone https://github.com/status-im/go-watchdog &&\ | ||
cd go-watchdog &&\ | ||
git checkout v1.2.0-ios-nolibproc &&\ | ||
cd ../.. &&\ | ||
echo "$(GO_MOD_REPLACEMENT)" >> go.mod &&\ | ||
go mod tidy | ||
|
||
prepare-gomobile: | ||
go install golang.org/x/mobile/cmd/gomobile@latest &&\ | ||
go get -u golang.org/x/mobile/bind && go install golang.org/x/mobile/bind | ||
|
||
build-fula-xcframework: | ||
gomobile init &&\ | ||
gomobile bind -v -o Fula.xcframework -target=ios github.com/functionland/go-fula/mobile | ||
|
||
bundles: | ||
mkdir -p build &&\ | ||
cp LICENSE ./build/LICENSE && cd build &&\ | ||
cp ../Fula.xcframework/ios-arm64/Fula.framework/Fula libfula_ios.a &&\ | ||
cp ../Fula.xcframework/ios-arm64_x86_64-simulator/Fula.framework/Fula libfula_iossimulator.a &&\ | ||
zip -r ./cocoapods-bundle.zip ./libfula_iossimulator.a ./libfula_ios.a && echo "$$(openssl dgst -sha256 ./cocoapods-bundle.zip)" > ./cocoapods-bundle.zip.sha256 | ||
|
||
clean-up: | ||
grep -v "$(GO_MOD_REPLACEMENT)" ./go.mod > ./tmp.mod ; mv ./tmp.mod ./go.mod &&\ | ||
rm -rf ./tmp-fula-build &&\ | ||
rm -rf ./build &&\ | ||
go mod tidy |
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